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("%04f %04f\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){
        double detA;
        detA = a * e - b * d;
        x = (c * e - f * b) / detA;
        y = (a * f - c * d) / detA;
        cout << fixed << setprecision(3) << x + 0.0001 << " " << setprecision(3) << y + 0.0001 << '\n';
    }
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  double a, b, c, d, e, f;
  while(cin >> a){
    cin >> b >> c >> d >> e >> f;
    double det = a * e - b * d;
    cout << setprecision(12);
    cout << (ll)((e * c - b * f) / det);
    cout << " ";
    cout << (ll)((- d * c + a * f) / det) << endl;
  }
	return 0;
}

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

int main()
{
  double a[10],b[10];
  for(int i=0;i<6;i++)
  {

	  cin>>a[i];
	  if((a[i]>1000)||(a[i]<-1000)){
	    cout << "nomber error" <<endl;
	    return 0;
     }
  }
  for(int i=0;i<6;i++)
  {

	  cin>>b[i];
	  if((b[i]>1000)||(b[i]<-1000)){
	    cout << "nomber error" <<endl;
	    return 0;
     }
  }
  cout<<fixed<<setprecision(4)<<(a[2]*a[4]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3])<<" ";
  cout<<fixed<<setprecision(4)<<(a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4])<<" ";
  cout<<fixed<<setprecision(4)<<(b[2]*b[4]-b[1]*b[5])/(b[0]*b[4]-b[1]*b[3])<<" ";
  cout<<fixed<<setprecision(4)<<(b[2]*b[3]-b[0]*b[5])/(b[1]*b[3]-b[0]*b[4])<<" ";
  return 0;
}

C++: #include<stdio.h>
int main(void)
{
	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 = (c-a*x)/b;
		printf("%.3lf %.3lf\n",x,y);

		
	}
	return 0;
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

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-f*b)/(a*e-d*b);
		y = (c-a*x)/b;
		printf("%.3lf %.3lf",x,y);
	}
}

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

		X= floor(X*1000+0.5)/1000;
		Y= floor(Y*1000+0.5)/1000;

		if(Y==0){
			Y=0.000;
		}

		if(X==0){
			X=0.000;
		}

		cout<<fixed<<setprecision(3)<<X<<" "<<fixed<<setprecision(3)<<Y<<endl;
	}

	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, const char * argv[])
{
    double a=0.0;
    double b=0.0;
    double c=0.0;
    double d=0.0;
    double e=0.0;
    double f=0.0;
    double x=0.0;
    double y=0.0;
    int end=0;
    
    while(scanf("%d",&end)!=EOF){
        a=end;
        scanf("%lf",&b);
        scanf("%lf",&c);
        scanf("%lf",&d);
        scanf("%lf",&e);
        scanf("%lf",&f);
        
        y = (d*c-a*f)/(d*b-a*e);
        x = (c-b*y)/a;
        
        printf("%.3lf",x);
        printf(" ");
        printf("%.3lf\n",y);
        
    }
    
}

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

int main(){
	double a, b, c, d, e, f;
	double x, y;
	double A, B, C;
	const double p = 0.00000001;

	while (cin >> a >> b >> c >> d >> e >> f){
		A = (a*e) - (b*d);
		B = (c*e) - (b*f);
		C = (a*f) - (c*d);

		x = B / A;
		y = C / A;
		
		if (abs(x) < p) x = 0;
		if (abs(y) < p) y = 0;

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

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

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<sstream>
#include<iomanip>
using namespace std;

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

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

using namespace std;

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

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
  double a, b, c, d, e, f;
  while(cin >> a >> b >> c >> d >> e >> f){
    double aa = a * d, bb = b * d, cc = c * d;
    double ee = e * a, ff = f * a;
    double y = (cc - ff) / (bb - ee);
    double x = (cc - bb * y) / aa;

    printf("%0.3f %0.3f\n", x, y);
  }
  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 x=(c*e-b*f)/(a*e-b*d),y=(c*d-a*f)/(b*d-a*e);
    if(x==0)x=0;
    if(y==0)y=0;
    cout <<fixed<<setprecision(3)<< x <<" "<< y <<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(void){
    double a, b, c, d, e, f;
    cout << fixed << setprecision(3);
    while(cin >> a >> b >> c >> d >> e >> f){
        if(a != 0){
            if(a != 1){
                b = b / a;
                c = c / a;
                a = a / a;
            }
            e = e - b * d / a;
            f = f - c * d / a;
            d = d - d / a;
            if(e != 1){
                f = f / e;
                e = e / e;
            }
            c = c - f * b / e;
            b = b - b / e;
        }
        cout << c << " " << f << endl;
    }
    
    return 0;
}