Go: package main

import "fmt"

func main() {
	var Xs, Ys []float32
	Xs = make([]float32, 0)
	Ys = make([]float32, 0)
	var cnt int
	for {
		var a, b, c, d, e, f, x, y float32
		fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if a == 0 {
			break
		}
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		Xs = append(Xs, x)
		Ys = append(Ys, y)
		cnt++
	}
	for i := 0; i < cnt; i++ {
		fmt.Printf("%.3f %.3f\n", Xs[i], Ys[i])
	}
}

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;
    }
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
void calc(double x1, double y1, double a, double x2, double y2, double b)
{
	double d1 = x2;
	double d2 = x1;
	double xx1 = d1 * x1;
	double xy1 = d1 * y1;
	double a1 = d1 * a;
	double xx2 = d2 * x2;
	double xy2 = d2 * y2;
	double b1 = d2 * b;
	double y = xy1 - xy2;
	double c = a1 - b1;
	y = c / y;


	d1 = y2;
	d2 = y1;
	xx1 = d1 * x1;
	xy1 = d1 * y1;
	a1 = d1 * a;
	xx2 = d2 * x2;
	xy2 = d2 * y2;
	b1 = d2 * b;
	double x = xx1 - xx2;
	c = a1 - b1;
	x = c / x;
	if (x == 0)
	{
		x = 0;
	}
	if (y == 0)
	{
		y = 0;
	}
	printf("%.3lf %.3lf\n", x, y);
}
int main(int argc, char const *argv[])
{
	int x1, y1, a, x2, y2, b;

	while(scanf_s("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &b) != EOF)
	{
		calc(x1, y1, a, x2, y2, b);
	}

		
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main () {
	double m[4], e, f, d, x, y;
	cout.setf (ios::fixed); cout.precision (3);
	while (cin >> m[0] >> m[1] >> e >> m[2] >> m[3] >> f) {
		d = m[0]*m[3] - m[1]*m[2];
		if (0.0 == ((x = (m[3]*e - m[1]*f)/d) + 0.0)) x = 0.0;
		if (0.0 == ((y = (m[0]*f - m[2]*e)/d) + 0.0)) y = 0.0;
		cout << x << " " << y << endl;
	}
}