Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var a, b, c, d, e, f float64
        sc := bufio.NewScanner(os.Stdin)
        for sc.Scan() {
                fmt.Sscanf(sc.Text(), "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)

                det := a*e - b*d
                x := (e*c - b*f) / det
                y := (a*f - c*d) / det
                fmt.Printf("%.3f %.3f\n", x, y)
        }
}

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) {//係数値を入力している。
		double tmp = x1;
		x1 *= x2; y1 *= x2; z1 *= x2;//xの係数で連立する。
		x2 *= tmp; y2 *= tmp; z2 *= tmp;
		y = (z1 - z2) / (y1 - y2);//ｙを計算する。
		if (z1 - z2 == 0)y = 0;//-0.000にならないようにしている。
		x = (z1 - (y1*y)) / x1;//xの計算
		if (z1 - (y1*y) == 0)x = 0;//-0.000にならないようにしている。
		int a, b;
		a = x * 10000;//小数第4桁の四捨五入
		if (a % 10 > 4) {
			a += 10;
			x = double(a) / 10000;
		}
		b = y * 10000;//小数第4桁の四捨五入
		if (b % 10 > 4) {
			b += 10;
			y = double(b) / 10000;
		}
		cout << fixed;//小数第4桁までを出力したい
		cout << setprecision(3) << x << ' ' << y << endl;

	}
	return 0;
}

C++: #include <iomanip>
#include <iostream>
 
using namespace std;
 
int main()
{ 
	ios::sync_with_stdio(0);
	cin.tie(0);

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

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

	return 0;
}

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

using namespace std;

int main(){
	
	float a, b, c, d, e, f;
	float x, y;
	
	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));
	
	if (x == 0){
		x = 0;
	}else if (y == 0){
		y = 0;
	}
	
	cout << fixed << setprecision(3) << x << "," << y << endl;
	
	return 0;
}

C++: #include<stdio.h>

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

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

int main()
{
	int a,b,c,d,e,f;
	double def;
	double x,y;
	while(scanf("%d %d %d %d %d %d",&a, &b, &c, &d, &e, &f) != EOF){
		if((a * e - b * d) != 0){
			def = 1 / (double)(a * e - b * d);
		}else{
			printf("NA\n");
			continue;
		}
		x = def * (double)(e * c - b * f);
		y = def * (double)(a * f - d * c);
		if(x > 0){
			x -= 0.0005;
		}else if(x < 0){
			x += 0.0005;
		}
		if(y > 0){
			y -= 0.0005;
		}else if (y < 0){
			y += 0.0005;
		}
		if(abs(x) < 0.0005){
			x = 0.000;
		}
		if(abs(y) < 0.0005){
			y = 0.000;
		}
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

C++: #include<stdio.h>
int main(void) {
	int a, b, c, d, e, f, g, h = 0;
	while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF)
		for (double x = -1000; x <= 1000; x++)
		{
			for (double y = -1000; y <= 1000; y++)
			{
				if (a*x + b*y == c&&d*x + e*y == f)
				{
					printf("%.4f %.4f\n", x, y);
				}
			}
		}
	h++;
	return 0;
}

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

int main(){

	float a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f)
	{
		cout<<setprecision(3)<<(c*e - b*f) / (e*a - b*d)<<" ";
		cout<<setprecision(3)<<(d*c - a*f) / (b*d - a*e)<<endl;
	}
	

	
    return 0;
}

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

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

  return 0;
}

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

using namespace std;

double format(double value) {
    return ((int)(value*1000.0+0.5)) / 1000.0;
}

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

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

        cout << fixed << setprecision(3) << bufferX << " " << bufferY << endl;
    }

    return 0;
}

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

using namespace std;

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

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

		double tempb = b;

		a*=e;b*=e;c*=e;
		d*=tempb;e*=tempb;f*=tempb;
		a-=d;b-=e;c-=f;

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

		if(x == -0)
			x = 0;
		if(y == -0)
			y = 0;
		printf("%0.4lf %0.4lf\n",x,y);
	}

	return 0;
}

C++: #include <stdio.h>

int main(void){
	double x;
	for(; scanf("%lf", &x) != EOF; ){
		if( (int)x != x ) return 1;
	}
	return 0;
}

C++: 
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#define pi 3.14159265358979323846264338
using namespace std;

int main() {
	int a, b, c, d, e, f;
	double by, ey, x, y, cc, ff;
	while (cin >> a >> b >> c >> d >> e >> f) {
		by = b*d;
		cc = c*d;
		ey = e*a;
		ff = f*a;
		y = abs(ff - cc) / abs(by - ey);
		x = (c - b*y) / a;
		int xx = x * 10000, yy = y * 10000;
		if (xx % 10 >= 5) {
			x += 0.001;
		}
		if (yy % 10 >= 5) {
			y += 0.001;
		}
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
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*e);
  
      if(abs(x) < 0.001) x = 0;
      if(abs(y) < 0.001) y = 0;
      printf("%.3f %.3f\n",x,y);
      
    }
    return 0;
}

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

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

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

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

C++: #include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
using namespace std;
int size(string x){
	string::size_type size=x.size();
	return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define fi first
#define se second
typedef  vector<string> vs;
typedef  vector<int> vi;
double pi(){
	return M_PI;
}
typedef set<int> set_i;
typedef set<string> set_s;
int main(){
	double a,b,c,d,e,f,a1;
	while(cin>>a>>b>>c>>d>>e>>f){
		double x,y;
		a1=a;
		a=a*d;
		b=b*d;
		c=c*d;
		d=d*a1;
		e=e*a1;
		f=f*a1;
		y=(c-f)/(b-e);
		x=(f-e*y)/d;
		if(x==0) x=0;
		if(y==0) y=0;
		printf("%.3lf %.3lf\n",x,y);
	}
}

C++: #include <stdio.h>
 
double xxx(double a, double b, double c, double d, double e, double f){
 
if(b!=1.000){
a=a/b;
c=c/b;
b=1.000;
}
 
a=a*e;
b=b*e;
c=c*e;
 
a=a-d;
b=b-e;
c=c-f;
 
return c/a;
 
}
 
double yyy(double a, double b, double c, double d, double e, double f){
 
if(a!=1.000){
b=b/a;
c=c/a;
a=1.000;
}
 
a=a*d;
b=b*d;
c=c*d;
 
a=a-d;
b=b-e;
c=c-f;
 
return c/b;
 
}
 
 
int main(void){
 
double a, b, c, d, e, f;
 
while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f)!=-1){
 
printf("%.3f %.3f\n", xxx(a, b, c, d, e, f), yyy(a, b, c, d, e, f));
 
}
 
return 0;
}