Go: package main

import "fmt"

func main() {
	var Xs, Ys []float32
	Xs = make([]float32, 0)
	Ys = make([]float32, 0)
	var cnt 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
		}
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		Xs = append(Xs, x)
		Ys = append(Ys, y)
		cnt++
	}
	for i := 0; i < cnt; i++ {
		fmt.Printf("%.3f %.3f\n", Xs[i], Ys[i])
	}
}

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


double a,b,c,d,e,f;
double x,y;//x,y座標
int main(){
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) !=EOF){
    

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

    if(y > 0){
      y =floor((y+0.0005)*1000)/1000;
    }
    if(y < 0){
      y =-1*(floor((fabs(y)+0.0005)*1000)/1000);
    }
    if(x > 0){//小数第4位を四捨五入
      x =floor((x+0.0005)*1000)/1000;
    }
    if(x <0){
      x =-1*(floor((fabs(x)+0.0005)*1000)/1000);
    }
    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

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

int main() {
	//ax + by = c
	//dx + ey = f

	int A, B, C, D, E ,F = 0;
	cin >> A >> B >> C >> D >> E >> F;

	int COMMON_A = D;
	int COMMON_B = A;
	
	A *= COMMON_A;
	B *= COMMON_A;
	C *= COMMON_A;
	D *= COMMON_B;
	E *= COMMON_B;
	F *= COMMON_B;

	int X,Y;
	Y = (E-B);
	if((F-C) == 0 && (E-B) < 0)
		Y = -Y;
	float y = (F-C) / (E-B);

	X = (C-B*y);

	float x;
	x = (C- B * y) / A;
	if (X == 0 && A < 0)
		x = -x;

	printf("%0.3f %0.3f\n",x,y);

	return 0;
}

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

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

C++: #include <iostream>
#include <cstdio>
using namespace std;
const double EPS = 1e-9;

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

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

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

	while (cin >> a >> b >> c >> d >> e >> f){
		double x, y;
		x = (c * e - b * f) / (a * e - b * d);
		y = (c - (a * x)) / b;
		
		if (x == -0.000) x = 0.000;
		if (y == -0.000) y = 0.000;

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

	return (0);
}

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

C++: #include <math.h>
#include <algorithm>
#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)
	{
		-1000 <= a, b, c, d, e, f <= 1000;
		x= (c*e-b*f)/(a*e-b*d);
		y= (c*d-a*f)/(b*d-a*e);
		if(x == -0.00){x=0.00;}
		if(y == -0.00){y=0.00;}
                round(x);
                round(y);
		cout<<setprecision(3);
                cout << setiosflags(ios::fixed);
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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

int main(){

	double a,b,c,d,e,f;
	double x,y;
	register double alpha;

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

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

		if(x == -0.00)x=0.0;
		if(y == -0.00)y=0.0;

		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;

	}

	return 0;

}

C++: #include <iostream>
#include <iomanip>
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-d*b);
    y = (c-a*x) / c;
    cout << fixed << setprecision(3) << x << " " << y << endl;
  }
  return 0;
}

C++: #include<stdio.h>

int main(void)
{
	int a,b,c,d,e,f,t=0,n;
	double x[100]={0},y[100]={0};
	
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF)
	{
		x[t]=(c*e-b*f)/(a*e-b*d);
		y[t]=(d*c-a*f)/(b*d-a*e);
		t++;
	}

	for(n=0;n<t;n++)
	{
		printf("%.3f %.3f\n",x[n],y[n]);
	}
}

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

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

int main(){
	int T;
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double D = a*e-b*d;
		double x = c*e-b*f;
		double y = a*f-c*d;
		x /= D;
		y /= D;
		x += 1e-9;
		y += 1e-9;
		printf("%.4lf %.4lf\n",x,y);
	}
}

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

int main() {
        int a, b, c, d, e, f;
        double x, y;
        char line[200];

        while(fgets(line, 200, stdin) != NULL) {
                sscanf(line, "%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f);
                x = ((double)(e*c - b*f)) / (a*e - d*b);
                y = ((double)(a*f - d*c)) / (a*e - d*b);
                if(abs(x) < 1.0e-4) x = 0;
                if(abs(y) < 1.0e-4) y = 0;
                printf("%.3f %.3f\n", x, y);
        }
}

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

int main(){
	double A[2][2];
	double B[2][1];
	double x,y;
	while(cin >> A[0][0] >> A[0][1] >> B[0][0] >> A[1][0] >> A[1][1] >> B[1][0]){
		A[0][1] /= A[0][0];
		B[0][0] /= A[0][0];
		A[1][1] -= A[1][0]*A[0][1];
		B[1][0] -= A[1][0]*B[0][0];
		B[1][0] /= A[1][1];
		B[0][0] -= A[0][1]*B[1][0];
		cout << fixed<< setprecision(3) << B[0][0] << " " << setprecision(3) << B[1][0] << endl;
	}
	return 0;
}

C++: #include <iostream>

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

    while (std::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);
        printf ("%.3f %.3f\n", x == 0 ? 0 : x , y == 0 ? 0 : y);
    }

    return 0;
}

C++: #include <iostream>
#include <stdio.h>
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 = (f-d*x)/e;
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

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

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

  while( cin >> a >> b >> c >> d >> e >> f ) {
    det = a*e-b*d;
    float x = (c*e-f*b)/det;
    float y = (-c*d+f*a)/det;
    x = (x==-0.0)?0.0:x;  // Convert -0.0 to 0.0
    y = (y==-0.0)?0.0:y;
    cout << setiosflags(ios::fixed) << setprecision(3);
    cout << x << " " << y << endl;
  }

  return 0;
}

C++: #include<stdio.h>
int main(void){

	double a, b, c, d, e, f;
	double A,B;
	double x, y;

	while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
		 
	 
	 if ( (a > 0 && d <　0)|| (a > 0 && d > 0)) {
		A = c*d - f*a;
		B = b*d - e*a;
        y = A / B;
    }
    
    else {
		A = c*d + f*a;
		B = b*d + e*a;
        y = A / B;
    }


    x = (c - y * b) / a;
	printf("%.3f %.3f\n" ,x , y);
	}
	return 0;

}