Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		strNums := strings.Fields(scanner.Text())
		nums := []int{}
		for _, strNum := range strNums {
			num, _ := strconv.Atoi(strNum)
			nums = append(nums, num)
		}
		a := nums[0]
		b := nums[1]
		c := nums[2]
		d := nums[3]
		e := nums[4]
		f := nums[5]
		lcm := lcm(a, d)
		mulA := lcm / a
		mulD := lcm / d
		a *= mulA
		b *= mulA
		c *= mulA
		d *= mulD
		e *= mulD
		f *= mulD

		if d < 0 {
			d *= -1
			e *= -1
			f *= -1
		}

		bE := b - e
		cF := c - f
		if bE==0{
		    bE=1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		
			fmt.Printf("%d.000 ", x)
			fmt.Printf("%d.000\n", y)
	}
}

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

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

        if (x == 0){ x = 0; }
        if (y == 0){ y = 0; }
        printf("%.3f %.3f\n", x, y);
    }

    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,e,f;
    double x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        x=(b*f-c*e)/(b*d-a*e);
        y = (a*f-c*d)/(a*e-b*d);
        if(x == 0) x = 0;
        if(y == 0) y = 0;
        printf("%.3f %.3f\n",x,y);
    }
    return 0;
}

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

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++: #include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>

#define pi acos(-1)
#define mx 5000005

using namespace std;

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

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

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

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

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

//大文字を小文字に変換
/*
for(int i=0;i<inp.size();i++)
if(inp[i]>='A' && inp[i]<='Z')
inp[i]+='a'-'A';
*/

C++: #define _CRT_SECURE_NO_WARNINGS
#include <queue>
#include <set>
#include <map>
#include <list>
#include <stack>
#include <cmath>
#include <functional>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iterator>
#include <algorithm>
#include <iostream>

#define aLL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXISt(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define MAX 100000000
#define PI 3.14159265258979
#define pb push_back
#define mp make_pair
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;
int dx[] = { 0, 1, 0, -1 };
int dy[] = { -1, 0, 1, 0 };

int sttoi(std::string str) {
	int ret;
	std::stringstream ss; ss << str;
	ss >> ret;
	return ret;
}

int gcd(int a, int b){
	if (b > a)swap(a, b);
	if (b == 0)return a;
	return gcd(b, a%b);
}

void solve() {
	int a, b, c, d, e, f;
	double x, y;
	while (scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f) != -1){
	y = (double)(d*c - a*f) / (double)(b*d - a*e);
	x = (double)(c - b*y) / (double)a;
	x *= 1000;
	y *= 1000;
	x = round(x);
	y = round(y);
	x /= 1000;
	y /= 1000;
	cout << setprecision(3) << fixed << x << " " << y << endl;
	}
}

int main() {
	solve();
	return 0;
}

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

int main(){

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

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

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

		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;

	}

	return 0;

}

C++: #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double x = double(e * c - b * f) / (e * a - b * d);
        double y = double(c - a * x) / b;
        cout << fixed << setprecision(3) << x << " " << y << "\n";
    }
}

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

#define COL 3 //列
#define LINE 2 //行

//連立方程式1つとxyの答えを持つ
typedef struct{
	double data[LINE][COL];
	double x_answer;
	double y_answer;
} Question;


int main(){
	Question q[10];
	int q_num = 0;//問題数
	int i,j,k = 0;
	int d;

	//入力の最後まで処理
	while( cin >> d ){
		for(i=0; i<LINE; i++){
			for(j=0; j<COL; j++){
				scanf("%lf",&q[q_num].data[i][j]);
			}
		}
		
		q_num++;
	}

	//問題を解く処理
	for(i=0; i<q_num; i++){
		//前進消去
		//(2)' = (2)-(1)*a10/a00
		for(j=COL-1; j>=0; j--){
			q[i].data[1][j] -= q[i].data[0][j] * q[i].data[1][0] / q[i].data[0][0];
		}
		
		q[i].y_answer =  q[i].data[1][2] / q[i].data[1][1] ;

		q[i].x_answer =  (q[i].data[0][2] - q[i].data[0][1] * q[i].y_answer) / q[i].data[0][0] ;

	}

	for(k=0; k<q_num; k++){
		printf("%.3lf %.3lf\n",q[k].x_answer,q[k].y_answer);
	}


	return 0;
}

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

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define MOD 1000000007 //10^9+7
#define INF 1000000000 //10^9

pair<double, double>equ2(int a,int b,int c,int d,int e,int f);

pair<double, double>equ2(int a,int b,int c,int d,int e,int f){
    double det=1.0/(a*e-b*d);
    double x=(double)(c*e-b*f)*det;
    double y=(double)(a*f-c*d)*det;
    if (x==-0) x=0;if (y==-0) y=0;
    return pair<double, double>(x,y);
}



int main ()
{
    int a,b,c,d,e,f;
    while (cin>>a>>b>>c>>d>>e>>f) {
        pair<double,double> ans=equ2(a,b,c,d,e,f);
        
        printf("%.3f %.3f\n",ans.first,ans.second);
    }
    return 0;
}