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++: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                double x, y;
                double[] h = new double[6];
                String str = Console.ReadLine();
                if (str == null) break;
                string[] s = str.Split();
                for (int i = 0; i < 6; i++)
                {
                    h[i] = double.Parse(s[i]);
               
                x = ((h[2] * h[4]) - (h[1] * h[5])) / ((h[0] * h[4]) - (h[1] * h[3]));
                y = ((h[2] * h[3]) - (h[0] * h[5])) / ((h[3] * h[1]) - (h[0] * h[4]));
                x = Math.Floor(x * 1000) / 1000;
                y = Math.Floor(y * 1000) / 1000;
                Console.WriteLine("{0:0.000} {1:0.000}", x, y);

            }
        }
    }
}

C++: #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	double line[6];
	double anx,any;
	for(int ii=0;ii<2;++ii)
	{
		for(int i=0;i<6;++i)
		{
			cin>>line[i];
		}
		double doll;
		doll=line[0];
		for(int i3=0;i3<3;++i3)
		{
			line[i3]*=line[3];
		}
		for(int i3=3;i3<6;++i3)
		{
			line[i3]*=doll;
		}
		double bu[3];
		for(int i4=0;i4<3;++i4)
		{
			bu[i4]=line[i4];
			line[i4]-=line[i4+3];
		}
		any=line[2]/line[1];
		anx=(bu[2]-bu[1]*any)/bu[0];
		if(anx==0){
			anx=0;
		}
		if(any==0){
			any=0;
		}
		cout<<fixed << setprecision(4)<<anx<<" "<<any<<endl;
	}
	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 = (e*c - b*f) / (e*a - d*b);
        double y = (a*f - d*c) / (e*a - d*b);
        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;
	cin>>a>>b>>c>>d>>e>>f;

	float det = a*e-b*d;
	float x = 1/det*(c*e - b*f);
	float y = 1/det*(-c*d + a*f);	
	if(x < 0.0000001) x = 0;
	if(y < 0.0000001) y = 0;

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

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

int main() {
    double a,b,c,d,e,f;
    double x,y;
    
    while(cin >> a >> b >> c >> d >> e >> f){
        x = (double)((e*c-b*f) / (a*e-b*d));
        y = (double)((-(d*c)+a*f) / (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>
#include<iomanip>
using namespace std;

int main()
{
	int 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 << fixed
			<< setprecision(3)
			<< x<<" "<<y<< endl;
	}

	return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>

using namespace std;

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

int main(){
	double a,b,c,d,e,f;
	while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF){
		
		if(d==0){
			swap(a,d);
			swap(b,e);
			swap(c,f);
		}
		
		double y;
		if(a==0){
			y = b/c;
		}else{
			double A = b/a-e/d;
			double B = c/a-f/d;
			
			y = B/A;
		}
		double x = f/d-e/d*y;
		
		
		printf("%.9lf %.9lf\n",x,y);
	}
}

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

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

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){

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

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

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

	return 0;
}

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

using namespace std;

int main()
{
	int a[1000],b[1000],c[1000],d[1000],e[1000],f[1000];
	float x[1000],y[1000];
	int len=0;
	while (cin >> a[len] >> b[len] >> c[len] >> d[len] >> e[len] >> f[len])
		len++;

	for (int i=0; i < len; i++) {
		x[i] =  ((e[i] * c[i] - b[i] * f[i]) / (e[i] * a[i] - b[i] * d[i]));
		y[i] =  ((c[i] * d[i] - f[i] * a[i]) / (b[i] * d[i] - a[i] * e[i]));
	}
	for (int i=0; i < len; i++) {
		printf("%.3lf %.3lf\n",x[i],y[i]);
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
	double a,b,c,d,e,f,n[20];
	while(cin>>a>>b>>c>>d>>e>>f){
	double x,y;
	int w;
	if(a == 0){
		n[0] = 0;
		n[1] = 0;
	}else{
		n[0] = c / a;
		n[1] = b / a;
	}
	if(d == 0){
		n[2] = 0;
		n[3] = 0;
	}else{
		n[2] = f / d;
		n[3] = e / d;
	}
	if(b == 0){
		n[4] = 0;
		n[5] = 0;
	}else{
		n[4] = c / b;
		n[5] = a / b;
	}
	if(e == 0){
		n[6] = 0;
		n[7] = 0;
	}else{
		n[6] = f / e;
		n[7] = d / e;
	}
	if(n[1] - n[3] == 0){
		y = 0;
	}else{
		y = (n[0] - n[2]) / (n[1] - n[3]);
	}
	if(n[5] - n[7] == 0){
		x = 0;
	}else{
		x = (n[4] - n[6]) / (n[5] - n[7]);
	}
	x = x * pow(10, - 5);
	double xx = x + 0.5;
	xx = xx * pow(10,5);
	y = y * pow(10, - 5);
	double yy = y + 0.5;
	yy = yy * pow(10,5);

	printf("%0.3f,%0.3f\n",&xx,&yy);



}
return 0;
}

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

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

  return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
double Emat(int a,int b,int c,int d);

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

double Emat(int a,int b,int c,int d){
	return a*d-b*c;
}

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

C++: #include<iostream>
#include<iomanip>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<functional>
#include<string>
#include<cstring>
#include <sstream>
using namespace std;
int main(void){
    double a,b,c,d,e,f,x,y;
    while(cin >> a >> b >> c >> d >> e >> f){
        double ad = a / d;
        d *= ad;
        e *= ad;
        f *= ad;
        d -= a;
        e -= b;
        f -= c;
        y = f/e;
        x = (c - b * y)/a;
        y *= 1000;
        y = round(y);
        y /= 1000;
        x *= 1000;
        x = round(x);
        x /= 1000;
        cout << fixed << setprecision(3) << x << " " << y << endl;
    }
    return 0;
}