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 <iomanip>
#include <cmath>

using namespace std;

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

    while (cin >> a >> b >> c >> d >> e >> f) {
        answer1 = static_cast<double>(e * c - b * f) / (a * e - b * d);
        answer2 = static_cast<double>(-d * c + a * f) / (a * e - b * d);
        if (answer1 == 0) answer1 = 0.000;
        if (answer2 == 0) answer2 = 0.000;
        cout << fixed << setprecision(3) << round(answer1) << " " << round(answer2) << endl;
    }
    
    return 0;
}

C++: const int tt = 10000;

#include<iostream>
#include<string>
#include<sstream>
using namespace std;

string toStr(int n);
string intToString(int n);

int main() {
  int a, b, c, d, e, f;
  
  while(cin >> a >> b >> c >> d >> e >> f) {
    c = c * tt;
    f = f * tt;

    int det = a * e - b * d;

    int x = ( e * c - b * f) / det;
    int y = (-d * c + a * f) / det;
//    cout << x << y << endl;

    cout << toStr(x) << " " << toStr(y) << endl;
  }
}

string toStr(int n) {
  string pm, val;
  
  if (n < 0) {
    pm = "-";
    n = -n;
  } else {
    pm = "";
  }

  int ipart = n / tt;
  int fpart = (n - ipart * tt) + tt + 5;

  val = pm + intToString(ipart) + "." + intToString(fpart).substr(1, 3);
  return val;
}

string intToString(int n) {
  stringstream ss;
  ss << n;
  return ss.str();
}

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

#define rep(p,q) for(int i = p; i < q;i++)

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

C++: #include <iostream>
#include <stdlib.h>
#include <string.h>
#include <sstream>
#include <iostream>
#include <math.h>
#include <iomanip>

using namespace std;

string float_to_string(float f, int digits)
{
  if (f == 0) {
    f = 0;
  }
  ostringstream oss;
  oss << setprecision(digits) << setiosflags(ios::fixed) << f;
  return oss.str();
}

void calc_and_output(int *c)
{
  float x = (float)(c[1]*c[5]-c[2]*c[4])/(c[1]*c[3]-c[0]*c[4]);
  float y = (float)(c[0]*c[5]-c[2]*c[3])/(c[0]*c[4]-c[1]*c[3]);

  cout << float_to_string(x, 3) << " " << float_to_string(y, 3) << endl;
}

int main(int argc, char const* argv[])
{
  int c[6];

  string line;
  while (getline(cin, line)) {
    istringstream iss(line);
    int val;
    int c[6];
    for (int i = 0; i < 6; i++) {
      iss >> val;
      c[i] = val;
    };

    calc_and_output(c);
  }

  return 0;
}

C++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004&lang=jp
#include <algorithm>
#include <vector>
#include <iostream>
#include <math.h>
//#include <bits/stdc++.h>	//C++標準ライブラリ一括読み込み
using namespace std;

// ax+by=c
// dx+ey=f
double unko(double x){
	int y=int(round(x*1000));
	return double(y/1000);
}

int main(){
    double a,b,c,d,e,f;
    cin>>a>>b>>c>>d>>e>>f;
//	long long x=(c*e-b*f)/(a*e-b*d)+0.0005;
//	long long y=(c*d-a*f)/(b*d-a*e)+0.0005;
//	printf("%.3f %.3f",x,y);
	double x=(c*e-b*f)/(a*e-b*d);
	double y=(c*d-a*f)/(b*d-a*e);
	printf("%.3f %.3f",unko(x),unko(y));
    return 0;
}

C++: #include <cstdio>
using namespace std;
float a,b,c,d,e,f,t;
int main(){
  for(;~scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f);
    t=a*e-b*d,printf("%.3f %.3f\n",(e*c-b*f)/t+0.,(a*f-d*c)/t+0.)
  );
  return 0;
}

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

int main(){
	double a[6];
	double x,y;
	cout<< setprecision(4) << setiosflags(ios::showpoint);
	while(true){
		if(cin.eof())
			break;
		cin >> a[0];
		cin >> a[1];
		cin >> a[2];
		cin >> a[3];
		cin >> a[4];
		cin >> a[5];

			
		x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		if(x == 0)
			x = 0;
		if(y == 0)
			 y = 0;
			 
		cout << x << " " << y << endl;
	}
	return 0;
}

C++: #include <cstdio>

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

void solve(){
	double x = 1.0 * (c * e - b * f) / (a * e - b * d);
	double y = (c - a * x) / b;
	if(x == -0)x = 0;
	if(y == -0)y = 0;
	printf("%.3lf %.3lf\n", x, y);
}

int main(int argc, char const *argv[]){
//	freopen("in.txt", "r", stdin);

	while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF){
		solve();
	}
	
	return 0;
}

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

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

		x = round(x*1000)/1000+10e-5;
		y = round(y*1000)/1000+10e-5;

		cout << x << " " <<  y << endl;
	}

	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999

const double EPS = 1e-8;
typedef vector<double> vd;
typedef vector<vd> mat;

//Ax=b????§£??? A?????£?????????
//?§£??????or????????§?????? ??´????????????0???vector?????????
vd gauss_jordan(const mat& A, const vd& b){
    int n=A.size();
    mat B(n,vd(n+1));
    rep(i,n) rep(j,n) B[i][j]=A[i][j];
    
    rep(i,n) B[i][n] = b[i];                                    //??????A????????????b?????????????????????????????????
    
    rep(i,n){
        int pivot = i;
        for(int j=i;j<n;j++){                                   //??¨????????????????????°????????°?????¶???????????§????????????i??????????????£?????????
            if(abs(B[j][i])>abs(B[pivot][i]))pivot = j;
        }
        swap(B[i],B[pivot]);
        
        if(abs(B[i][i])<EPS)return vd();                        //?§£??????or????????§??????
        
        for(int j=i+1;j<=n;j++)B[i][j]/=B[i][i];                //??¨????????????????????°????????°???1?????????
        rep(j,n){
            if(i!=j){
                for(int k=i+1;k<=n;k++)B[j][k]-=B[j][i]*B[i][k];//j??????????????°????¶????
            }
        }
    }
    vd x(n);
    rep(i,n)x[i]=B[i][n];    //??????????????????b????§£?????????
    return x;
}

int main(){
    int a,b,c,d,e,f;
    while(cin>>a>>b>>c>>d>>e>>f){
        vd vec;
        vec.pb(c);
        vec.pb(f);
        mat mvec;
        vd x,y;
        x.pb(a);
        x.pb(b);
        y.pb(d);
        y.pb(e);
        mvec.pb(x);
        mvec.pb(y);
        vd res = gauss_jordan(mvec, vec);
        printf("%.3lf %.3lf\n",res[0],res[1]);
    }
}

C++: #include<iostream>
#include<iomanip>
using namespace std;
int main(void) {
    double a, b, c, d, e, f;
    while(cin >> a >> b >> c >> d >> e >> f){
        double x = (f - (c*e/b)) / (d - ((a*e)/b));
        double y = (c/b) - (a/b) * x;

        cout << fixed;
        cout << setprecision(3) << x << ' ' << y << endl;
    }
}

C++: #include <iostream>
#include <cstdio>
int main(void){
	double a,b,c,d,e,f,x,y;
	while(std::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;
		if(y==0)y=0;
		printf("%.3f %.3f\n",x,y);
	}
}

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

int main(){
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double det = a*e-b*d;
		double x = 1/det*(c*e - b*f);
		double y = 1/det*(-c*d + a*f);	
        if(x == -0.0) x=0;
        if(y == -0.0) y=0;

		cout << fixed << setprecision(3) << x << ' ' << y <<endl;
	}
	return 0;
}