Go: package main

import "fmt"

func main() {
	var resultX, resultY [100]float32
	var count int
	for {
		var a, b, c, d, e, f, x, y float32
		fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if a == 0 {
			break
		}
		//Simultaneous equation
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		resultX[count] = x
		resultY[count] = y
		count++
	}
	for i := 0; i < count; i++ {
		fmt.Printf("%.3f %.3f\n", resultX[i], resultY[i])
	}
}

C++: #include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

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

    while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f) != EOF){
        double x = (c * e - b * f) / (double)(a * e - b * d);
        double y = (a * f - c * d) / (double)(a * e - b * d);

        if(-1e-3 < x && x < 1e-3)
            x = 0.0;
        if(-1e-3 < y && y < 1e-3)
            y = 0.0;
        printf("%0.3lf %0.3lf\n",x,y);
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	double a, b, c, d, e, f, x, y;
	while (!cin.eof()) {
		cin >> a >> b >> c >> d >> e >> f;
		double bd = b*d;
		double ea = e*a;
		double cd = c*d;
		double fa = f*a;
		y = (cd - fa) / (bd - ea);
		x = (c - b*y) / a;
		printf("%3f %3f\n", x, y);
	}
}

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

using namespace std;
double round(double value);

int main(){
  double a,b,c,d,e,f;
  vector<double> al,bl,cl,dl,el,fl;
  double x,y,n,m;

  while(cin >> a >> b >> c >> d >> e >> f){
    al.push_back(a);
    bl.push_back(b);
    cl.push_back(c);
    dl.push_back(d);
    el.push_back(e);
    fl.push_back(f);
  }

  for(int i=0; i<al.size(); i++){
    /*
    n = bl[i]/el[i];
    m = al[i]/dl[i];
    x = (cl[i]-n*fl[i])/(al[i]-n*dl[i]); 
    y = (cl[i]-m*fl[i])/(bl[i]-m*el[i]);
    */
    y = (cl[i]*dl[i]-al[i]*fl[i])/(bl[i]*dl[i]-el[i]*al[i]);
    x = (cl[i] - ( bl[i] * y)) /al[i];
    printf("%0.3f %0.3f\n", x,y);
  }

  return 0;
}


double round(double value){
  return floor(value*1000 + 0.5)/1000;
}

C++: #include <cstdio>

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

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

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

C++: #include <iostream>

using namespace std;

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

	while(cin >> a >> b >> c >> d >> e >> f){

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

	}
	printf("%.3f %.3f\n", x, y);
}

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

using namespace std;

int main(int argc, char *argv[]) {
  double a, b, c, d, e, f;

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

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 = f/d-e/d*y;
		
		
		printf("%.3lf %.3lf\n",x,y);
	}
}

C++: #include<stdio.h>
#include<math.h>

int main(void){
	double x1,y1;
	int a=0,b=0,c=0,d=0,e=0,f=0,x2,y2;
    
    while(scanf("%d %d %d %d %d %d\n",&a,&b,&c,&d,&e,&f) != EOF)
	{
	    x2 = (c * e -b * f) / (a * e - b * d)*1000+0.5;
	    y2 = (a * f -d * c) / (a * e - b * d)*1000+0.5;

		x1 = x2/1000;
		y1 = y2/1000;
		printf("%lf %lf\n",x1,y1);
	}
  return 0;
}

C++: #include<stdio.h>

int main()
{
    int a, b, c, d, e, f;
    while (scanf("%d", &a) != EOF) {
        scanf("%d", &b);
        scanf("%d", &c);
        scanf("%d", &d);
        scanf("%d", &e);
        scanf("%d", &f);
        printf("%f ", (double) (c*e - b*f) / (a*e - b*d ));
        printf("%f\n", (double) (- c*d + a*f) / (a*e - b*d ));
        
    }
    return 0;
}

C++: #include <stdio.h>

int main() {
    float a, b, c, d, e, f;
    while(scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f) != EOF) {
        float det = a*e - b*d;
        float x = (c*e-b*f)/det;
        float y = (-c*d+a*f)/det;
        x = x==-0.0f?0.0f:x;
        y = y==-0.0f?0.0f:y;
        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)
	{
		x= (c*e-b*f)/(a*e-b*d);
		y= (c*d-a*f)/(b*d-a*e);
		cout<<setprecision(3)<<fixed;
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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

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

return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <queue>
#include <cmath>

using namespace std;

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

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

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

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

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);

  double a, b, c, d, e, f;

  while (cin >> a, cin >> b, cin >> c, cin >> d, cin >> e, cin >> f) {
    printf("%.3f %.3f\n", (c * e - f * b) / (a * e - d * b) + 0, (c * d - f * a) / (b * d - e * a) + 0);
  }

  return 0;
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    int a,b,c,d,e,f;
    float x,y;
    while(scanf("%d %d %d %d %d %d", &a,&b,&c,&d,&e,&f))
    {

        int i=a*e-b*d;
        int j=c*e-b*f;
        int k=a*f-c*d;
        x=j/i;
        y=k/i;
        printf("%.3f %.3f", x,y);

    }
    return 0;
}

C++: #include<iostream>

int main(int, char**)
{
	double a, b, c, d, e, f = 0;
	while (std::cin >> a >> b >> c >> d >> e >> f)
	{
		double y = std::roundl((c * (a - d) - a * (c - f)) / (b * (a - d) - a * (b - e)) * 1000.0) / 1000.0;
		double x = std::roundl(((c - f) - (b - e) * y) / (a - d) * 1000.0) / 1000.0;
		printf("%.3f %.3f\n", x + 0, y + 0);
	}
}