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<algorithm>
#include<cstdio>
#include<cmath>
#define min 0.000000001
using namespace std;

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

C++: #include <stdio.h>
#include <cmath>
using namespace std;

int main(void) {
  float a, b, c, d, e, f;
  while (scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)+1)  {
    float x = (c*e-b*f)/(a*e-b*d);
    float y = (c*d-a*f)/(b*d-a*e);
    if (abs(x) <= 1.0e-4) x = 0.0;
    if (abs(y) <= 1.0e-4) y = 0.0;
    printf("%.3f %.3f\n", x, y);
  }
  return 0;
}

C++: #include<cstdio>

using namespace std;

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

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

int main(void){
	int a,b,c,d,e,f;
	double x,y;
	while(cin >> a >> b >> c >> d >> e >> f){
		y = (f - c - e)/(a + b);
		x = (c - b * y)/a;
		cout << x << ' ' << y << endl;
	}
	return 0;
}

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

int main()
{

  int a,b,c,d,e,f;
  double x,y;

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

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

  return 0;
}

C++: #include <bits/stdc++.h>
// #include "bits/stdc++.h"

#define pout(n)  printf ("%d\n", n)

#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)

const int d4x[4] = {1, 0, -1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 };
 
typedef long long ll;
using namespace std;
 
int main() {
  double a,b,c,d,e,f,x,y;

  while(cin >> a >> b >> c >> d >> e >> f){
    y = (c*d-a*f)/(b*d-a*e);
    x = (c-b*y)/a;
  }
  

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

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

using namespace std;

int main(void){
	double arr[6];
	vector<double> x,y;

	while (cin >> arr[0] >> arr[1] >> arr[2] >> arr[3] >> arr[4] >> arr[5]){
		double a = arr[0]; double b = arr[1]; double c = arr[2]; double d = arr[3]; double e = arr[4]; double f = arr[5];
		x.push_back((c*e-b*f)/(a*e-b*d));
		y.push_back((c*d-a*f)/(b*d-a*e));
	}
	for (unsigned int i=0; i<x.size(); ++i){
		printf("%.3lf %.3lf\n", x[i], y[i]);
	}
	return 0;
}

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

double sisya(double x)
{
	double a = x;
	if(x < 0)
		a = -x;
			a = a*1000;
	a = a - static_cast<double>(static_cast<int>(a));
	a = a+0.5;
	if(a >= 1.0){
		return x + 0.001;
	}
	return x;
}

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

C++: #include <iostream>
#include <stdio.h>
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);

      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));
        if(-0.0005<x && x<=0)
            x=0;
        if(-0.0005<y && y<=0)
            y=0;
        printf("%.3f %.3f\n",x,y);
    }
    
    return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;



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

C++: #include<stdio.h>
#include<math.h>
double sg(double x){
	if ( x >= 0.0 ) {
		return (0.001*(floor(x + 0.0005)))*1000;
	} else {
    	return (-0.001 * floor(fabs(x) + 0.0005))*1000;
	}
}
int main(){
	double a,b,c,d,e,f,x,y;
	while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){
		y=sg(((c*d)-(a*f))/((b*d)-(a*e)));
		x=sg(((c*e)-(b*f))/((a*e)-(b*d)));
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

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

inline void swap(int &a, int &b) { int t = a; a = b; b = t; }

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 = e*c - b*f;
    int y = a*f - d*c;
    
    double xx = 0, yy = 0;
    if (x != 0) xx = (double)x/det;
    if (y != 0) yy = (double)y/det;
    printf("%.3f %.3f\n", xx, yy);
  }
  return 0;
}

C++: /*
	0004:Simultaneous Equation
*/
#include	<iostream>
#include	<cstdio>

using namespace std;

int main(void) {
	while(1) {
		double a, b, p, c, d, q;
		cin >> a >> b >> p >> c >> d >> q;
		
		if( cin.eof() ) { break; }
		
		printf("%.3f %.3f\n", (d * p - b * q) /(a * d - b * c), (a * q - c * p) / (a * d - b * c));
	}
	return 0;
}

C++: #include <iostream>

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", (e*c-f*b)/(e*a-b*d), (d*c-f*a)/(b*d-a*e));
	return 0;
}

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

int main()
{ 
	double x1, x2, y1, y2, z1, z2;
	double x, y;
	while (cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2) {
		x = x1;
		x1 *= x2; y1 *= x2; z1 *= x2;
		x2 *= x; y2 *= x; z2 *= x;
		y = (z1 - z2) / (y1 - y2);
		if (z1 - z2 == 0)y = 0;
		x = (z1 - (y1*y)) / x1;
		if (z1 - (y1*y) == 0)x = 0;
		int a, b;
		a = x * 10000;
		b = y * 10000;
		if (a % 10 > 4) {
			a += 10;
			x = double(a) / 10000;
		}
		if (b % 10 > 4) {
			b += 100;
			y = double(b) / 10000;
		}
		cout << fixed;
		cout << setprecision(3) << x << ' ' << y << endl;

	}
	return 0;
}

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

int main(){
	while(true){
		double a,b,c,d,e,f;
		cin>>a>>b>>c>>d>>e>>f;
		if(cin.fail()) break;
		cout<<showpoint<<setprecision(4)<<(c*e-b*f)/(a*e-b*d)<<" "<<(c*d-a*f)/(b*d-a*e)<<endl;
	}
	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) {
		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<cstdio>
using namespace std;
int main(){
  double m[2][2],inv[2][2],a[2],det;
  while(cin >>m[0][0]>>m[0][1]>>a[0]>>m[1][0]>>m[1][1]>>a[1]){
    det = m[0][0]*m[1][1]-m[0][1]*m[1][0];
    inv[0][0] = m[1][1]/det;
    inv[0][1] = -m[0][1]/det;
    inv[1][0] = -m[1][0]/det;
    inv[1][1] = m[0][0]/det;
    printf("%.3lf %.3lf\n",a[0]*inv[0][0]+a[1]*inv[0][1],a[0]*inv[1][0]+a[1]*inv[1][1]);
  }
  return 0;
}