Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var strs []string
	var a, b, c, d, e, f float64
	var x, y float64
	for scanner.Scan() {
		strs = strings.Split(scanner.Text(), " ")
		_a, _ := strconv.Atoi(strs[0])
		_b, _ := strconv.Atoi(strs[1])
		_c, _ := strconv.Atoi(strs[2])
		_d, _ := strconv.Atoi(strs[3])
		_e, _ := strconv.Atoi(strs[4])
		_f, _ := strconv.Atoi(strs[5])
		a = float64(_a)
		b = float64(_b)
		c = float64(_c)
		d = float64(_d)
		e = float64(_e)
		f = float64(_f)
		y = (c*d - f*a) / (d*b - a*e)
		x = (c - b*y) / a

		fmt.Printf("%.3f %.3f\n", x, y)
	}
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(void){
    double a, b, c, d, e, f;
    cout << fixed << setprecision(3);
    while(cin >> a >> b >> c >> d >> e >> f){
        if(a != 0){
            if(a != 1){
                b = b / a;
                c = c / a;
                a = a / a;
            }
            e = e - b * d / a;
            f = f - c * d / a;
            d = d - d / a;
            if(e != 1){
                f = f / e;
                e = e / e;
            }
            c = c - f * b / e;
            b = b - b / e;
        }
        cout << c << " " << f << endl;
    }
    
    return 0;
}

C++: File Edit Options Buffers Tools C++ Help                                           
#include <iostream>
#include <iomanip>
#include <cmath>


using namespace std;
#define RENT 100000

int main(){
  int n;
  int cnt=0;

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

    float detA = a*e - b*d;
    float x = (e*c + (-b)*f)/(detA);
    float y = ((-d)*c + a*f)/(detA);

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

C++: #include<stdio.h>
int main()

{
    float a,b,c,d,e,f;
    while(scanf("%f%f%f%f%f%f",a,b,c,d,e,f))
    {
        
        float x=(c*e-b*f)/(a*e-b*f);
        float y=(c*d-a*f)/(b*d-a*e);
        printf("%.3f %.3f\n",x,y);
        
    }
    return 0;
}

C++: /* AOJ0004 */
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
using namespace std;

int main(){
  // むずすぎぃ
  double a, b, c, d, e, f;
  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;
  }
  return 0;
}

C++: import java.io.*;
import java.text.DecimalFormat;
class Main{

    public static void main(String[] args)throws IOException{
	BufferedReader br =new BufferedReader(new  InputStreamReader(System.in));
	String buf;
	double[][] data=new double[2][3];
	double x,y;
	while((buf=br.readLine()) != null){
	    String[] buf2=buf.split(" ");
	    for(int i=0;i<data.length;i++){
		for(int j=0;j<data[i].length;j++){
		    data[i][j]=Double.parseDouble(buf2[i*3+j]);
		}
	    }
	    double a,b,c,d;
	    a=(data[0][2] * data[1][1] - data[0][1] * data[1][2]);
	    b=(data[0][0] * data[1][1] - data[1][0] * data[0][1]);
	    c=(data[0][2] * data[1][0] - data[1][2] * data[0][0]);
	    System.out.println(c);
	    d=(data[0][1] * data[1][0] - data[0][0] * data[1][1]);
	    System.out.println(d);
	    x = a / b;
	    y = c / d;
	    DecimalFormat decimalFormat1 = new DecimalFormat("#.000");
	    System.out.print(decimalFormat1.format(x));
	    System.out.print("\t");
	    System.out.println(decimalFormat1.format(y));
	}
    }
}

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

int main() {
	int a, b, c, d, e, f;
	int cnt = 0;
	bool flg = true;
	std::vector<double> x_vector;
	std::vector<double> y_vector;

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

		cnt++;
		x_vector.push_back(x);
		y_vector.push_back(y);
	}

	for (unsigned int i = 0; i < cnt; i++) {
		std::cout << std::fixed;
		std::cout << std::setprecision(3) << x_vector[i] << " ";
		std::cout << std::setprecision(3) << y_vector[i] << endl;
	}

	return 0;
}

C++: #include<stdio.h>
int main(void) {
	int a, b, c, d, e, f, g, h=0;
	while (1)
	{
		scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f);
		for (double x = -1000; x <= 1000; x++)
		{
			for (double y = -1000; y <= 1000; y++)
			{
				if (a*x + b*y == c&&d*x + e*y == f)
				{
					printf("%.4f %.4f", x, y);
				}
			}
		}
	}

	return 0;
}

C++: #include <iostream>
int main(){
	for(double a,b,c,d,e,f;;){
		std::cin>>a>>b>>c>>d>>e>>f;
		if(std::cin.eof())break;
		double y = (c*d-a*f)>(b*d-a*e)?((c*d-a*f)/((b*d-a*e)*1000))/1000:((c*d-a*f)*1000/(b*d-a*e))/1000;
		double x = (f-e*y)>d?((f-e*y)/(d*1000))/1000:((f-e*y)*1000/d)/1000;
		printf("%0.3lf %0.3lf\n",
		x,
		y);
	}
}

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)
	{
		y = (c*d-f*a)/(b*d-a*e);
		x = (c-b*y)/a;
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main( void ) {
    double a, b, c, d, e, f;
    a = 2; b = -1; c = -3; d = 1; e = -1; f = -3;
    double y = ((c*d - a*f) / (b*d - a*e));
    double x = ((c*e - f*b) / (a*e - b*d));
    int iy = (int)(y * 1000);
    int ix = (int)(x * 1000);
    y = iy / 1000.0; x = ix / 1000.0;
    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 << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl;
    }
    return 0;
}

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

int main(){
	double a11=0,a12=0,c=0,a21=0,a22=0,f=0;
	while(cin>>a11){
		cin>>a12>>c>>a21>>a22>>f;
		double x,y,delta=((double)a11*a22-(double)a12*a21);
		x=((double)a22*c-(double)a12*f)/delta;
		y=((double)a11*f-(double)c*a21)/delta;
		if(x>0){x=(double)(((int)((x*1000)+0.5))/1000);
		}else{x=(double)(((int)((x*1000)-0.5))/1000);}
		if(y>0){y=(double)(((int)((y*1000)+0.5))/1000);
		}else{y=(double)(((int)((y*1000)-0.5))/1000);}
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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

int main() {
	int 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);
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

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

int main(void){
    int a,b,c,d,e,f;
    double ansX,ansY;
    while(std::cin >> a >> b >> c >> d >> e >> f){
        ansX = (c*e - b*f) / (a*e - b*d);
        ansX *= 1000;
        if(ansX > 0) ansX += 0.5;
        else ansX -= 0.5;
        ansX = int(ansX);
        ansX /= 1000;
        
        ansY = (a*f - c*d) / (a*e - b*d);
        ansY *= 1000;
        if(ansY > 0) ansY += 0.5;
        else ansY -= 0.5;
        ansY = int(ansY);
        ansY /= 1000;
        
        std::cout <<fixed << setprecision(3) << ansX << " " << fixed << setprecision(3)<<ansY << std::endl;
    }
}