Go: package main

import "fmt"

func main() {

	for {
		var a, b, c, d, e, f float64
		var x, y float64
		i, _ := fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if i != 6 {
			return
		}

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

		fmt.Printf("%.3f %.3f\n", x, y)
	}
}

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) {
		double ansX = (e*c - b*f) / (a*e - b*d);
		double ansY = (a*f - d*c) / (a*e - b*d);
		if (ansX < 0.0005&&-0.0005 < ansX)ansX = 0;
		if (ansY < 0.0005&&-0.0005 < ansY)ansY = 0;
		printf("%.3f %.3f\n", ansX, ansY);
	}

	return 0;
}

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

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

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

C++: #include<iostream>
using namespace std;
void sort(int &a, int &b, int &c);

int main() {
	int a,b,c,d,p,q;
	while(cin>>a>>b>>p>>c>>d>>q) {
		double x=(d*p-b*q)/(d*a-b*c);
		double y=(c*p-a*q)/(c*b-a*d);

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

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

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

	
	while (~scanf( "%d%d%d%d%d%d" ,&a,&b,&c,&d,&e,&f) )
	
	{
		double y=(double)(c*d-a*f)/(double)(b*d-a*e);
		if(a!=0)
		
		printf("%.3f %.3f\n",(c-b*y)/a,y);
		else
		printf("%.3f %.3f\n",(f-e*y)/d,y);
	}

  
    
    return 0;
    
    }

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

int main(void){
    double a,b,c,d,e,f;
    double ansX,ansY;
    while(std::cin >> a >> b >> c >> d >> e >> f){
        ansX = (c*e - b*f) / (a*e - b*d);
        ansX *= 1000;
        if(ansX > 0) 
            ansX += 0.5;
        else 
            ansX -= 0.5;
        ansX = int(ansX);
        ansX /= 1000;
        
        ansY = (a*f - c*d) / (a*e - b*d);
        ansY *= 1000;
        if(ansY > 0) 
            ansY += 0.5;
        else
            ansY -= 0.5;
        ansY = int(ansY);
        ansY /= 1000;
        
        std::cout <<fixed << setprecision(3) << ansX << " " << fixed << setprecision(3)<<ansY << std::endl;
    }
    
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <string>

using namespace std;

vector<double> split(string str)
{
  vector<double> vec;
  string s;

  for(int i = 0; i < str.size(); ++i){
    s = "";
    while(i < str.size() && str[i] != ' ') s += str[i++];
    if(s.size()) vec.push_back(atof(s.c_str()));
  }

  return vec;
}

int main()
{
  string str;
  vector<double> vec;
  double t, r1, r2;

  while(getline(cin, str)){
    vec = split(str);
    t = vec[0]*vec[4]-vec[1]*vec[3];
    r1 = (vec[2]*vec[4]-vec[1]*vec[5])/t;
    r2 = (vec[0]*vec[5]-vec[2]*vec[3])/t;
    if(r1 == -0.0) r1 = 0.0;
    if(r2 == -0.0) r2 = 0.0;
    printf("%.3lf %.3lf\n", r1, r2);
  }

  return 0;
}

C++: #include <iostream>
int main(){
float a,b,c,d,e,f;
while(std::cin>>a>>b>>c>>d>>e>>f)printf("%.3f %.3f\n",(f*b-e*c)/(d*b-a*e), (f*a-d*c)/(a*e-b*d));
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#include <sstream>
#include <stdio.h>
using namespace std;

// Simultaneous Equation(0004)
int main()
{
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		double x = (e*c - b*f) / static_cast<double>(a*e - b*d);
		double y = (d*c - a*f) / static_cast<double>(b*d - a*e);
		
		if (x >= 0)
			x += 0.0005;
		else
			x -= 0.0005;

		if (y >= 0)
			y += 0.0005;
		else
			y -= 0.0005;

		int xx = x * 1000;
		int yy = y * 1000;

		printf("%.3lf %.3lf\n", xx/1000.0, yy/1000.0);

	}
	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>
#include <ctype.h>
using namespace std;
double a,b,c,d,e,f,x,y;
int main(){
	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);
	printf("%.3lf", x+1-1);
	cout<<" ";
	printf("%.3lf\n", y+1-1);
	}
return 0;}

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

  return 0;
}

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

using namespace std;

int main(){
        double a, b, c, d, e, f, g, h, i, j, k, l, m, n, x, y;

        while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF){
                g = a * d;      //公倍数
                j = b;
                k = c;
                l = a;
                b *= g / a;
                c *= g / a;
                e *= g / d;
                f *= g / d;
                a *= g / a;
                d *= g / d;

                h = b - e;
                i = c - f;

                y = i / h;
                x = k - y * j;
                x /= l;
                y *= 1000;
                y = floor(y + 0.5);
                y /= 1000;
                x *= 1000;
                x = floor(x + 0.5);
                x /= 1000;

                printf("%.4f %.4f", x, y);
        }

        return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<string>

#define add push_back
#define inf 2147000000

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

using namespace std;

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

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	double a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double x = (c * e - f * b) / (a * e - d * b);
		double y = (c * d - f * a) / (b * d - a * e);
		//double x = (- b * y + c) / a;
		
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
	
	return 0;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main() {
int a,b,c,d,e,f;
while (cin>>a>>b>>c>>d>>e>>f) {
 double dx = b*f-c*e;
 double dy = a*f-c*d;
 double d  = a*e-b*d;
 cout << setprecision(4) << dx/d << ' ' << dy/d << endl;
 }
return 0;
}

C++: #include <stdio.h>


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

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


    cout.setf(ios::fixed);
    cout.precision(3);
    cout<<x<<" "<<y<<endl;
    }
    return 0;
}