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<bits/stdc++.h>
#define loop(i, a, b) for(int i = a; i < b; i++) 
#define rep(i, a) loop(i, 0, a)
using namespace std;
const int MOD = 1000000007;
const int inf = 1e8;
using vi = vector <int>;
using vvi = vector <vi>;
using vc = vector <char>;
using vvc = vector <vc>;
using vs = vector <string>;
using vvs = vector <vs>;
//g++ -std==c++14
//setprecision(10)
double a, b, c, d, e, f;

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

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  double m[2][2],x[2],mi[2][2],det;
  while(cin >>m[0][0]>>m[0][1]>>x[0]>>m[1][0]>>m[1][1]>>x[1]){
    det = m[0][0]*m[1][1]-m[0][1]*m[1][0];
    mi[0][0] = m[1][1]/det;
    mi[0][1] = -m[0][1]/det;
    mi[1][0] = -m[1][0]/det;
    mi[1][1] = m[0][0]/det;
    printf("%.3lf %.3lf\n",x[0]*mi[0][0]+x[1]*mi[0][1],x[0]*mi[1][0]+x[1]*mi[1][1]);
  }
  return 0;
}

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){

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

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

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

C++: #include <iostream>

using namespace std;

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

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

static double
round3(double r)
{
	r *= 1000.0;
	r = round(r);
	return (r / 1000.0);
}

int
main(void)
{
	char line[80];
	double a;
	double b;
	double c;
	double d;
	double e;
	double f;
	double x;
	double y;

	while (gets(line)) {
		if (sscanf(line, "%lf %lf %lf %lf %lf %lf",
				   &a, &b, &c, &d, &e, &f) == 6) {
			x = (c/a - (b*f)/(a*e))*((a*e)/(a*e - b*d));
			y = f/e - (d/e) * x;
			
			printf("%.3f %.3f\n", round3(x), round3(y));
		}
	}

	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
 
int main(){
    double a, b, c, d, e, f, x, y, det;
    while (scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF){
        det = b * d - a * e;
        y = (c * d - a * f) / det;
        x = (c - b * y) / a;
        printf("%.3f %.3f\n", x, y);
    }
    return 0;
}

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

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

	return 0;
}

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

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

int gcd(int a,int b){
	if(a<b)b%=a;
	if(b==0)return a;
	int c=b;b=a%b;a=c;
	return gcd(a,b);
}

int lcm(int a,int b){
	int c=gcd(a,b);
	return c*(a/c)*(b/c);
}

int main(){
	int a,b,c,d,e,f;
	double x,y;
	std::cin>>a>>b>>c>>d>>e>>f;
	int g=lcm(a,d);
	y=(c*g/a-f*g/d)/(b*g/a-e*g/d);
	x=(c-y*b)/a;
	printf("%.3f %.3f\n",x,y);
	return 0;
}

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

using namespace std;

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

		x=(e*c-f*b)/(e*a-b*d);
		y=(d*c-f*a)/(b*d-a*e);
		if(x<=0&&x>=(-0.0005))x=0;
		if(y<=0&&y>=(-0.0005))y=0;
		printf("%.3f %.3f\n",x,y);
		
	}
}

C++: main(){
    double a,b,c,d,e,f,t;
    for(;scanf("%lf%lf%lf&lf%lf%lf",&a,&b,&c,&d,&e,&f)==6;){
        t=a*e-b*d;
        printf("%.3lf%.3lf\n",(e*c-b*f)/t+0.0,(a*f-d*c)/t+0.0);
    }
    return 0;
}

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

int main()
{
	int 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);

		x == 0 ? x = 0.0L : x = (c*e - b*f) / (a*e - b*d);
		y == 0 ? y = 0.0L : y = (c*d - a*f) / (b*d - a*e);

		printf("%.3f %.3f\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);
		if(x==-0)x=0;
		if(y==-0)y=0;

		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++: #include <iostream>
#include <stdio.h>

using namespace std;

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

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

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

			if(x * 10000 >= 5){
				x += 0.001;
			}if(y * 10000 >= 5){
				y += 0.001;
			}

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

	return 0;
}

C++: 
import java.util.Scanner;
public class main{
	static int a,b,c,d,e,f;
	static double x,y;
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		while(true){
		a = s.nextInt();
		b = s.nextInt();
		c = s.nextInt();
		d = s.nextInt();
		e = s.nextInt();
		f = s.nextInt();
		x = (e*c-b*f)/(a+e-b*d);
		y = (a*f-d*c)/(a*e-b*d);
		System.out.printf("%4.3f",x);
		System.out.print(" ");
		System.out.printf("%4.3f",y);
		}
	}

}

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.setf(ios::fixed);
    cout.precision(8);
    double a1, b1, c1, a2, b2, c2;
    while(cin>>a1>>b1>>c1>>a2>>b2>>c2){
        double m = a1*b2-a2*b1;
        cout<<(c1*b2-c2*b1)/m<<' '<<(a1*c2-a2*c1)/m<<'\n';
    }
    return 0;
}

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

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

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

#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

int main(void){
    
    int i,j=0,k = 0,l=0,m = 0,n= 0;
    double a,b,c,d,e,f;
    double x1,x2;
    
    cin >> a >> b >> c;
    cin >> d >> e >> f;
    
    double gyouretusiki = (a*e - d*b);
    
    x1 = (c/a) - (b/gyouretusiki)*(f -((d*c)/a));
    
    x2 = ((a) /(gyouretusiki))*(f-((d*c)/a));
    
    
    printf("%.3f,%.3f\n",x1,x2);
    return 0;
            
                  
                  
    
}

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

void func(double, int);

int main(){

	double a, b, c, d, e, f, x, y, del;
	  
	while(cin >> a){
	
		cin >> b >> c >> d >> e >> f;
		
		del = a * e - b * d;
		x = (c * e - b * f) / del;
		y = (a * f - c * d) / del;
		
		func(x, -4);
		func(y, -4);
		
	  printf("%.3f %.3f", x, y);
	}

	return 0;
}

void func(double x, int n){
	
	x *= pow(10, -n-1);
	x = round(x);
	x *= pow(10, n+1);	

}