Go: package main

import (
  "fmt"
)

func main() {
  var a,b,c,d,e,f float64
  var x,y float64
  for _, err := fmt.Scan(&a, &b, &c, &d, &e, &f); err == nil;
   _, err = fmt.Scan(&a, &b, &c, &d, &e, &f) {
    y = (a*f-c*d)/(a*e-b*d)
    x = (c-b*y)/a
    fmt.Printf("%.3f %.3f\n", x,y)
  }
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
using namespace std;
int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		int a2 = a, b2 = b, c2 = c;
		int g = a, h = d;
		if (g > h) swap(g, h);
		while (g != 0) {
			int k = g;
			g = h%g;
			h = k;
		}
		h = (h*(a / h)*(d / h));
		if (a2 != 0){
			b = b*(h / a2); 
			c = c*(h / a2);
		}
		else {
			b = 0;
			c = 0;
		}
		if (d != 0) {
			e = e*(h / d);
			f = f*(h / d);
		}
		else {
			e = 0;
			f = 0;
		}
		long double ansx,ansy;
		if (e - b != 0)ansx = ((long double)(f - c) / (e - b));
		else ansx = 0;
		ansy = (c2 - ansx*b2) / a2;
		ansx = ansx * 1000;
		ansx = round(ansx);
		ansx /= 1000;
		ansy = ansy * 1000;
		ansy = round(ansy);
		ansy /= 1000;
		printf("%.3LF %.3LF\n", ansy, ansx);
	}
}

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

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

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

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

int main()
{
	int a, b, c, d, e, f;
	double x, y;
	while (cin >> a >> b >> c >> d >> e >> f)
	{
		y = (double)(a*f - c * d) / (double)(a*e - b * d);
		if (a != 0)
		{
			x = (double)(c - b * y) / (double)a;
			cout << x << y;
		}
		else
		{
			x = (double)(f - e * y) / (double)d;
			cout << x << y;
		}

	}
	getchar();
	getchar();
	return 0;
}

C++: #include<iostream>

using namespace std;
   
void Simultaneous()
{
    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 = ( a * f - c * d ) / ( a * e - b * d );
        
        cout.setf(ios::fixed); //"setf" is used for “half-adjusting”
        cout.precision(3); //precision is used for rould off three places of decimals
        
        //-0主要用来表&#36798;浮点数
        //-0有可能被用来表示一个可以四舍五入&#20026;零的&#36127;数，或者是一个从&#36127;方向上&#36235;近于零的数。
        // 下面的式子可&#35753;&#36127;0&#21464;成无符号的0
        if(x == 0)
        {
            x = 0;
        }
        
        if(y == 0)
        {
            y = 0;
        }
        
        cout<<x<<" "<<y<<endl;
    }
            
    return;
}
     
int main()
{     
    Simultaneous();
    return 0;
}

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

using namespace std;
int main(void){
	double a,b,c,d,e,f,x,y;
	cin >> a >> b >> c >> d >> e >> f;
	y = (f-d*c/a)/(e-d*b/a);
	x = c/a-b/a*y;
	printf("%.4f",x);
	printf(" ");
	printf("%.4f\n",y);	
}

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


/*
//my header
#include "define.h"
#include "geometry.h"*/

#define MyAbs(a) ((a)>0?(a):-(a))
#define MyEqualDoule(a,b) (MyAbs(a-b)<1e-6)

void init()
{
#ifdef _WIN32
	freopen("1.txt", "r", stdin);
#endif
}

void func();

int main()
{
	init();
	func();

	return 0;
}


void func()
{
	float a,b,c,d,e,f, x, y;
	while(~scanf("%f%f%f%f%f%f", &a, &b, &c, &d, &e, &f))
	{
		if(MyEqualDoule(a*e-b*d,0))
			x = 0;
		else
			x = (c*e-f*b)/(a*e - b*d);

		if(MyEqualDoule(b*d - a*e, 0))
			y = 0;
		else
			y = (c*d-a*f)/(b*d - a*e);
		printf("%.3lf %.3lf\n", x, y);
	}
}

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

int main(){
	double aa, bb, cc, a, b, c, d, e, f, x, y;				//®1:ax + by = c, ®2:dx + ey = f
	
	while(cin >>a >>b >>c >>d >>e >>f){						//EOFªüÍ³êéÜÅ[v
		aa = a; bb = b; cc = c;								//üÍ³ê½a, b, cÌlðÛ
		
		b /= a; c /= a; a /= a;								//®1F¼ÓðaÅé
		e /= d; f /= d; d /= d;								//®2F¼ÓðdÅé
		
		b -= e; c -= f;										//®1©ç®2ðø­, ÊÍ®1ÌÏÖ
		
		y = c / b;											//15sÚÌÊ©çyðvZ
		x = (cc - (bb * y)) / aa;							//®1ÉyðãüµxðvZ
		
		if(x < 0) x = ceil(x * 1000 - 0.5) / 1000;			//xð¬_ælÊÅlÌÜü(ÌÌê)(1000{¨0.5ðø­¨¬_Øã°¨1/1000{)
		else x = floor(x * 1000 + 0.5) / 1000;				//xð¬_ælÊÅlÌÜü(³ÌÌê)(1000{¨0.5ð«·¨¬_ØÌÄ¨1/1000{)
		if(y < 0) y = ceil(y * 1000 - 0.5) / 1000;			//xð¬_ælÊÅlÌÜü(ÌÌê)
		else y = floor(y * 1000 + 0.5) / 1000;				//xð¬_ælÊÅlÌÜü(³ÌÌê)
		
		printf("%.3f %.3f\n", x, y);						//x, yðoÍ
	}
	
	return 0;
}

C++: #include <cstdio>
#include <vector>

using namespace std;

int main(){
  double a,b,c,d,e,f;
  vector<double> out;
  while (scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF){
    out.push_back((c*e-b*f)/(a*e-b*d));
    out.push_back((c*d-a*f)/(b*d-a*e));
  }
  for (int i=0;i<out.size();i+=2){
    printf("%f %f\n",round(out[i]*1000)/1000.0,round(out[i+1]*1000)/1000.0);
  }
  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 <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define REP(i,N) for(int i = 0; i < (int)N; i++)

int main(){
	double hako[6];
	while(cin >> hako[0]){
		REP(i,5)cin >> hako[i+1];
		cout << (hako[2] - hako[5]*hako[1]/hako[4]) / (hako[0] - hako[3]*hako[1]/hako[4]);
		cout << " ";
		cout << (hako[2] - hako[5]*hako[0]/hako[3]) / (hako[1] - hako[4]*hako[0]/hako[3]);
		cout << endl;
	}
	return 0;
}

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

using namespace std;

int main(){

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

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

x = (double) (c*e-f*b)/(a*e-b*d);
y = (double) (c*d-a*f)/(b*d-a*e);
if(x==0) x = 0;
if(y==0) y = 0;

cout << setiosflags(ios::fixed) << setprecision(3) << x << " " << y << endl;
}
}

C++: #include <stdio.h>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <deque>
#include <math.h>
using namespace std;
int main()
{
    //freopen("input.txt","r",stdin);
    double a,b,c,d,e,f;
    while(cin>>a>>b>>c>>d>>e>>f)
    {
        double r1=b*f-e*c,r2=b*d-a*e;
        double x=r1/r2;

        double y= (c-a*x)/b;

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