Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		strNums := strings.Fields(scanner.Text())
		nums := []int{}
		for _, strNum := range strNums {
			num, _ := strconv.Atoi(strNum)
			nums = append(nums, num)
		}
		a := nums[0]
		b := nums[1]
		c := nums[2]
		d := nums[3]
		e := nums[4]
		f := nums[5]
		lcm := lcm(a, d)
		mulA := lcm / a
		mulD := lcm / d
		a *= mulA
		b *= mulA
		c *= mulA
		d *= mulD
		e *= mulD
		f *= mulD

		if d < 0 {
			d *= -1
			e *= -1
			f *= -1
		}

		bE := b - e
		cF := c - f
		if bE==0{
		    bE=1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		
			fmt.Printf("%d.000 ", x)
			fmt.Printf("%d.000\n", y)
	}
}

C++: #include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
#define N 2
 
using namespace std;
typedef vector< vector<double> > Equation;
 
int main()
{ 
    Equation c(N, vector<double>(N + 1));
	while (cin)
	{
		// input
		for (int i = 0; i < N; ++i)
			for (int j = 0; j < N + 1; ++j)
				cin >> c[i][j];

		// Gaussian elimination
		// 1. Forward elimination
        for (int i = 0; i < N - 1; ++i)
            for (int j = i + 1; j < N; ++j)
            {
                double d = c[j][i] / c[i][i];
                for (int k = i + 1; k <= N; ++k)
                    c[j][k] -= c[i][k] * d;
            }
 
		// 2. Back substitution
        for (int i = N - 1; i >= 0; --i)
        {
            double d = c[i][N];
            for (int j = i + 1; j < N; ++j)
                d -= c[i][j] * c[j][N];
            c[i][N] = d / c[i][i];
        }
 
		for (int i = 0; i < N; ++i)
			if (c[i][N] == 0)
				c[i][N] = 0;

        cout << setprecision(3) << fixed << c[0][N];
        for (int i = 1; i < N; ++i)
            cout << " " << c[i][N];
        cout << endl;
    }
 
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <stdio.h>

using namespace std;

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		G = A / D;
		D *= G;
		E *= G;
		F *= G;
		Y = (F-C) / (E-B);
		
		D /= G;
		E /= G;
		F /= G;
		H = B / E;
		D *= H;
		E *= H;
		F *= H;
		X = (F-C) / (D-A);

		if(X==0){X=0;};
		if(Y==0){Y=0;};

		printf("%.3f %.3f\n",X,Y);
	}

	return 0;
}

C++: #include <iostream>
#include <iomanip>

using namespace std;

int main(){
  int a,b,c,d,e,f;
  double x,y;
  while(cin>>a>>b>>c>>d>>e>>f){
    y = (double)(a*f-d*c) / (a*e - b*d);
    x = (c-b*y) / a;
    cout << setprecision(3) << setiosflags(ios::fixed) << x << ' ' << setprecision(3) << setiosflags(ios::fixed) << y << endl;
  }
  return 0;
}

C++: #include <stdio.h>

int main(void)
{
	int a, b, c, d, e, f;
	float x, y;
	
	while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF){
		for(x = -1000; x < 1000; x++){
			for(y = -1000; y < 1000; y++){
				if((float)(a * x) + (b * y) == c && (d * x) + (e * y) == f){
					printf("%.3f %.3f\n", x, y);
				}
			}
		}
	}
	return (0);
}

C++: #include <cstdio>
#include <iostream>

using namespace std;

int main(){
 double x,y,a,b,c,d,e,f;
 while(1){
  cin>>a>>b>>c>>d>>e>>f;
  if(a=="\n") break;
  x=(c*e-f*b)/(a*e-d*b);
  y=(a*f-d*c)/(a*e-d*b);
  printf("%.3lf %.3lf\n",x,y);
 }
 return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std; 
int main()
{
double a,b,c,d,e,f;
while(cin>>a>>b>>c>>d>>e>>f)
{
printf("%.3f %.3f\n", (1.0 * b*f - c*e)/(b*d - a*e), (1.0 * a*f - c*d)/(a*e - b*d));
}
return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
    float a,b,c,d,e,f,x,y;
    while(scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f)!=EOF)
    {
        x=(c*e-f*b)/(a*e-d*b);
        y=(c-a*x)/b;
        printf("%.3f %.3f\n",x,y);
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>

// x = (e * c - b * f) / (a * e - b * d)
// y = (a * f - d * c) / (a * e - b * d)

using namespace std;

int main() {
    double a, b, c, d, e, f;

    while (cin >> a >> b >> c >> d >> e >> f) {
        int det = a * e - b * d;
        double x = (e * c - b * f) / det + 0.0;
        double y = (a * f - d * c) / det + 0.0;
        printf("%.3f %.3f\n", x, y);
    }

    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
  double a, b, c, d, e, f, x = 0, y = 0;
  while(cin >> a >> b >> c >> d >> e >> f){

    y = (c * d - a * f) / (b * d - a * e);
    x = (c - b * y) / a;
    y *= 10000.0;
    if((int)y % 10 > 4) y += 1.0;
    y /= 10000.0;
    x *= 10000.0;
    if((int)x % 10 > 4) x += 1.0;
    x /= 10000.0;
    printf("%.3f %.3f\n", x, y);
}
     
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

int main(){
	double a,b,c,d,e,f;
	while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF){
		
		if(d==0){
			swap(a,d);
			swap(b,e);
			swap(c,f);
		}
		
		double y;
		if(a==0){
			y = b/c;
		}else{
			double A = b/a-e/d;
			double B = c/a-f/d;
			
			y = B/A;
		}
		double x = c/a-b/a*y;
		
		
		printf("%.9lf %.9lf\n",x,y);
	}
}

C++: #include <iostream>
#include <cstdio>
using namespace std;

int main(){
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double x = (c - b * f / e)/(a - b * d / e);
		double y = (c - a * x) / b;
		if(x == 0) x = 0;
		if(y == 0) y = 0;
		printf("%.3lf ", x);
		printf("%.3lf\n", y);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    double a,b,c,d,e,f;
    double x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        x=(e*c-b*f)/(a*e-d*b);
        y=(a*f-c*d)/(a*e-d*b);
        printf("%.3lf %.3lf\n",x,y);
    }
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(void){
    double a, b, c, d, e, f;
    double y;
    while(cin>>a>>b>>c>>d>>e>>f){
        y = (c*d-a*f)/(b*d-a*e);
        cout<<fixed;
        cout<<setprecision(3)<<(c-b*y)/a<<" " <<y<<endl;
    }
    
    return 0;
}

C++: #include <iostream>
#include <string>
#include<iomanip>
using namespace std;
int main(){
	double x,y;
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		x=(c-(b*f/e))/(a-(b*d/e));
		y=(c-a*x)/b;
        x*=1000;
        if(x>=0)
        x+=0.5;
		else
		x-=0.5;
        x=int(x);
        x/=1000;
	    y*=1000;
		if(y>=0)
        y+=0.5;
		else
		y-=0.5;
        y=int(y);
        y/=1000;
		cout<<fixed<<setprecision(3)<<x<<" ";
		cout<<fixed<<setprecision(3)<<y<<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;

int main()
{    
    
	int a,b,c,d,e,f;

	
	while (~ scanf( "%d%d%d%d%d%d" ,&a,&b,&c,&d,&e,&f) )
	
	{
		double y=(double)(c*d-a*f)/(double)(b*d-a*e);
		if(a!=0)
		
		printf("%.3f %.3f\n",(c-b*y)/a,y);
		else
		printf("%.3f %.3f\n",(f-e*y)/d,y);
	}

    return 0;
    
    }

C++: #include <iostream>

using namespace std;

/*
aX+bY=c
dX+eY=f
*/

void solve(int a, int b, int c, int d, int e, int f) {
	int x = (f - ec/b) / (d - ec/b);
	int y = (c - ax) / b;
	cout << x << " " << y << endl;
}

int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		solve(a,b,c,d,e,f);
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(){
	int a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f ){
	int det=a*e-b*d;
	int X,Y; X=c*e-b*f ; Y=a*f-c*d; 
	double x,y;
	if(X==0) x=0;if(Y==0) y=0;
	if(X!=0 && Y!=0) x=(double)X/det;y=(double)Y/det;
	cout << fixed << setprecision(3) ;
	cout << x << ' ' << y << '\n' ;
	};
}