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 <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {

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

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

	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;
while(cin >> a >> b >> c >> d >> e >> f){
  if(a*e-b*d != 0){
    x = (e*c-b*f) / (a*e-b*d);
    y = (-(d*c)+a*f) / (a*e-b*d);
  }

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

C++: #include <iostream>
#include <stdio.h>
#include <iomanip>
//#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>

using namespace std;

int main(){

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

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



	return 0;
}

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int 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,y);
  }
  

}

C++: //--------------------------------------------------template----------------------------------------//
//c
#include <stdio.h>
#include <time.h>
#include <math.h>
//c++
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <sstream>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <complex>
#include <cmath>
//c++11
#include <tuple>
#define all(c) ((c).begin(),(c).end())
#define rall(c) (c).rbegin(),(c).rend()
//#define sort(v,n) sort(v,v+n)
//#define vsort(v) sort(v.begin(),v.end())
#define vvsort(v) sort(v.rbegin(),v.rend())
#define ll long long
#define pb(a) push_back(a)
#define fi first
#define se second
#define inf 999999999
using namespace std;
const ll MOD = 1e9 + 7;
const double PI = acos(-1.0);
//---------------------------------------------------------------------------------------------//
double a, b, c, d, e, f;
double x, y;
int main() {
	while (cin >> a >> b >> c >> d >> e >> f) {
		x = (c*e - b*f) / (a*e - b*d);
		y = (c - a*x) / b;
		if (x == -1 * x)x = 0.000;
		if (y == -1 * y)y = 0.000;
		printf("%.3f %.3f\n", x, y);
	}
}

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

int main(){
	int a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double tmpx = (c*e-b*f)/(a*e-b*d);
		double tmpy = (c*d-a*f)/(b*d-a*e);
		double fx = 1, fy = 1;
		if(tmpx<0){
			fx = -1;
		}
		if(tmpy<0){
			fy = -1;
		}
		double x = round(tmpx*fx*1000)/(fx*1000);
		double y = round(tmpy*fy*1000)/(fy*1000);
		printf("%.3f %.3f", x, y);
	}
}

C++: #include<iostream>
using namespace std;
double Emat(int a,int b,int c,int d);

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

double Emat(int a,int b,int c,int d){
	return a*d-b*c;
}

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

using namespace std;

int main()
{
 double a=0,b=0,c=0,d=0,e=0,f=0;
 double x,y;
	while( cin>>a>>b>>c>>d>>e>>f )
	{
	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<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 = c/b;
		}else{
			double A = b/a-e/d;
			double B = c/a-f/d;
			
			y = B/A;
		}
		double x = f/d-e/d*y;
		
		if(x==fabs(x))x=fabs(x);
		if(y==fabs(y))y=fabs(y);
		
		printf("%.3lf %.3lf\n",x,y);
	}
}

C++: #include <stdio.h>
using namespace std;
int main() {
	int a, b, c, d, e, f;
	double x, y;
	while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) {
		int a1 = a, b1 = b, c1 = c, d1 = d, e1 = e, f1 = f;
		a1 *= e;
		b1 *= e;
		c1 *= e;
		d1 *= b;
		e1 *= b;
		f1 *= b;
		printf("%.3f ", (double) (f1 - c1) / (d1 - a1));
		a *= d;
		b *= d;
		c *= d;
		d *= a;
		e *= a;
		f *= a;
		printf("%.3f\n", (double) (f - c) / (e - b));
	}
	return 0;
}

C++: #include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
	float a,b,c,d,e,f,x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		y=(a*f-d*c)/(e*a-d*b);
		x=(c-b*y)/a;
		printf("%.3f %.3f\n",x,y);
	}
}

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

double halfadjust(double x){
	int tmp = (x*10000);
	tmp = tmp%10;
	double ans = static_cast<double>(static_cast<int>(x*1000));
	ans = ans/1000;
	if(tmp >= 5)
		ans += 0.001;
	if(tmp <= -5)
		ans -= 0.001;
	return ans;
}

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

void solve(){
	using namespace std;
	double x = (c*e-b*f)/(a*e-b*d);
	double y = (c*d-a*f)/(b*d-a*e);
	cout << setprecision(3) << fixed << halfadjust(x) << ' ';
	cout << halfadjust(y) << endl;
	cout << setprecision(6);
}

int main(){
	using std::cin
	while(cin >> a&& cin >> b&& cin >> c&& cin >> d&& cin >> e&& cin >> f){
		solve();
	}
	return 0;
}

C++: #include<stdio.h>

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

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

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

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

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)

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

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

int main(void){

  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 = (c*d - a*f)/(b*d - a*e);

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

}