Go: package main

import (
  "fmt"
)

func main() {
  var a,b,c,d,e,f float64
  var x,y float64
  for _, err := fmt.Scan(&a, &b, &c, &d, &e, &f); err == nil;
   _, err = fmt.Scan(&a, &b, &c, &d, &e, &f) {
    y = (a*f-c*d)/(a*e-b*d)
    x = (c-b*y)/a
    fmt.Printf("%.3f %.3f\n", x,y)
  }
}

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

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

  while(std::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);

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

  }
}

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 = (b * f - e * c) / (b * d - a * e);
    y = (c - a * x) / b;
    cout << fixed << setprecision(3) << x + 0 << " " << y + 0 << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
using namespace std;

#define MAX 1000

int main(void){

	float a, b, c, d, e, f;
	float ansx[MAX], ansy[MAX];

	int i = 0;

	while (scanf("%f%f%f%f%f%f", &a,&b,&c,&d,&e,&f) != EOF){
		if (a*e != b*d){
			ansx[i] = (c*e - b*f) / (a*e - b*d);
			ansy[i] = (c*d - a*f) / (b*d - a*e);
			if (((int)(ansx[i] * 10000) % 10) > 4 || ((int)(ansx[i] * 10000) % 10) < -4){
				ansx[i] += 0.001;
			}
			if (((int)(ansy[i] * 10000) % 10) > 4 || ((int)(ansy[i] * 10000) % 10) < -4){
				ansy[i] += 0.001;
			}
		}
		i++;
	}

	for (int j = 0; j < i; j++){
		printf("%.3f %.3f\n", ansx[j], ansy[j]);
	}
	
	return 0;
}

C++: #include<iostream>
#include <stdio.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-f*b)/(e*a-b*d);
		y=(d*c-f*a)/(b*d-a*e);

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

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

//0004
int main(){
	// ax + by = c
    // dx + ey = f
	// =>	x=(ce-bf)/(ae-bd)
	//      y=(cd-af)/(bd-ae)
	int a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double x,y;
		int temp_x, temp_y;
		

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

		temp_x==0 ? x=0.0L : x = (double)(c*e-b*f)/(a*e-b*d);
		temp_y==0 ? y=0.0L : y = (double)(c*d-a*f)/(b*d-a*e);
		
		printf("%.3f %.3f\n", x, y);

		//cout.precision(3);
		//cout << x << " " << y << endl;
	}

	return 0;
}

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

using namespace std;

int main(){

  int i;
  float a, b, c, d, e, f;
  float temp;
  float x, y;

  cout << "datasets: ";
  cin >> i;
  for(int j=0; j<i; j++){
    cin >> a >> b >> c >> d >> e >> f;

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

    cout << fixed << setprecision(3) << x << " " << y << "\n";
  }
  return 0;
}

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




  return 0;
}

C++: 
#include <stdio.h>

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

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

int main() {
  for(int i = 0; i < 31; i++){
    int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0;
    double x, y;
    cin >> a >> b >> c >> d >> e >> f;
    /*ax + by = c
      dx + ey = f
      行列で処理...?*/

      if(a == 0 && b == 0 && c == 0 && d == 0 && e == 0 && f == 0){
        break;
      }
      else{
        d * a * x + d * b * y - a * d * x - a * e * y == d * c - a * f;
        (d * b - a * e) * y == d * c - a * f;
        y = (d * c - a * f) / (d * b - a * e);
        //double Y = round(y * 1000); //1000倍して四捨五入して小数第4位までを取得
        //y = Y / 1000;
        x = (c - b * y) / a;
        //double X = round(x * 1000);
      //  x = X / 1000;

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

}

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

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

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;
}