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++: #include <iostream>
#include <iomanip>

double getValue(double val);

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

double getValue(double val)
{
    double result;
    val *= 1000;
    if(val >= 0.0){
        result = (int)(val + 0.5);
    }
    else{
        result = (int)(val - 0.5);
    }
    return result / 1000;
}

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

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

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

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

int main(void)
{
	int n;
	double a,b,c,d,e,f;
	double det, ia, ib, ic, id;
	double x,y;
	char buf[32];
	while(fgets(buf,32,stdin)!=NULL){
		n=sscanf(buf,"%lf %lf %lf %lf %lf %lf",&a,&b,&e,&c,&d,&f);
		if(n!=6)break;
		det = 1./(a*d - b*c);
		ia=d*det;
		ib=-b*det;
		ic=-c*det;
		id=a*det;
		x=ia*e+ib*f;
		y=ic*e+id*f;
		printf("%.3f %.3f\n", round(x*1000)/1000,round(y*1000)/1000);
	}
	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)
	{
		if (cin.eof()) break;
		y = (c*d - a*f) / (b*d - a*e);
		x = -b/a * y + c/a;
		cout << setprecision(3) << setiosflags(ios::fixed) << x << " " << y << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    double A[2][3];
    while(cin >> A[0][0] >> A[0][1] >> A[0][2] >> A[1][0] >> A[1][1] >> A[1][2]){
        for(int i = 1; i < 3; i++){
            A[0][i] /= A[0][0];
        }
        A[0][0] /= A[0][0];
        for(int i = 1; i < 3; i++){
            A[1][i] -= A[0][i] * A[1][0];
        }
        A[1][0] -= A[0][0] * A[1][0];
        for(int i = 0; i < 3; i++){
            if(i != 1)
                A[1][i] /= A[1][1];
        }
        A[1][1] /= A[1][1];
        for(int i = 0; i < 3; i++){
            if(i != 1)
                A[0][i] -= A[1][i] * A[0][1];
        }
        A[0][1] -= A[1][1] * A[0][1];
        
        printf("%.3f %.3f\n", A[0][2], A[1][2]);
    }
}

C++: /*
 * AOJ 4
 * Simultaneous Equation (PCK 2003)
 *
 */
#include <iostream>

using namespace std;

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

C++: #include<stdio.h>

int main(void)
{
	int a,b,c,d,e,f,t=0,n,cx,cy;
	double x[100]={0},y[100]={0};
	
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF)
	{
		x[t]=(c*e-b*f)/(a*e-b*d);
		y[t]=(d*c-a*f)/(b*d-a*e);
		t++;
	}

	for(n=0;n<t;n++)
	{
		if(x[n]>=0)
		{
			cx=x[n]*10000;
			cx=(cx+5)/10;
			x[n]=cx/1000;
		}
		else if(x[n]<0)
		{
			cx=x[n]*10000;
			cx=(cx-5)/10;
			x[n]=cx/1000;
		}

		if(y[n]>=0)
		{
			cy=y[n]*10000;
			cy=(cy+5)/10;
			y[n]=cy/1000;
		}
		else if(y[n]<0)
		{
			cy=y[n]*10000;
			cy=(cy-5)/10;
			y[n]=cy/1000;
		}

		printf("%.3f %.3f\n",x[n],y[n]);
	}
	return 0;
}

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

double a, b, c, d, e, f;
int main()
{
	while(std::cin>>a>>b>>c>>d>>e>>f)
	{
		double x = (e*c-b*f)/(a*e-b*d);
		double y = (-d*c+a*f)/(a*e-b*d);
		printf("%.3f %.3fn",x+(1e-10),y+(1e-10));
	}
	return 0;
}

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;

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

	return 0;
}

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

template <typename T> double round(const T r, const int n = 0){
    if(r>=0){
        return floor(r * pow(10, -n) + 0.5) * pow(10, n);
    }
    else{
        return ceil(r * pow(10, -n) - 0.5) * pow(10, n);
    }
}

int main(){
    double a, b, c, d, e, f;
	while(std::cin >> a){
		std::cin >> b >> c >> d >> e >> f;
		std::cout << std::fixed << std::setprecision(3)
			<< round((c * e - b * f) / (a * e - b * d), -3) << ' '
			<< round((a * f - c * d) / (a * e - b * d), -3) << std::endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int b,a,e,d,f,i,c;
	float y,x;
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF)  {
			y=(c*d-a*f)/(b*d-a*e);
			x=(c-(b*y))/a;
		if(x==-0.0000){
			x=0.0000;
		}
		if(y==-0.000){
			y=0.0000;
		}	
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

C++: #include<stdio.h>

int main(){
	double a,b,c,d,e,f,x,y,x2,y2;
	int status;
	while(1){
		status=scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
		if (status==EOF){
			break;
		}
		x=(f/e-c/b)/(d/e-a/b);
		y=c/b-a*x/b;
		x2=(b*f-c*e)/(b*d-a*e);
		y2=(c-a*x2)/b;
		
		if (x<0.0005 && x>-0.0005){
			x=0;
		}
		if (y<0.0005 && y>-0.0005){
			y=0;
		}
	//	printf("%.3f %.3f\n",x,y);
	//	printf("%f %f\n",x,y);
		printf("%.3f %.3f\n",x2,y2);
	//	printf("%f %f\n\n\n",x2,y2);
	}
	
	return 0;
}

C++: #include<cstdio>
using namespace std;
int main(){
	double matrix[4],ans[2];
	while(scanf("%lf %lf %lf %lf %lf %lf",&matrix[0],&matrix[1],&ans[0],&matrix[2],&matrix[3],&ans[1]) != EOF){
		double t = matrix[0]*matrix[3]-matrix[1]*matrix[2];
		printf("%.3lf %.3lf\n",matrix[3]*ans[0]/t-matrix[1]*ans[1]/t,-matrix[2]*ans[0]/t+matrix[0]*ans[1]/t);
	}
	return 0;
}

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

using namespace std;

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		X=(double)(C*E-F*B)/(A*E-D*B);
		Y=(double)(A*F-D*C)/(A*E-D*B);

		printf("%.3f %.3f\n",X,Y);
	}
	return 0;
}

C++: #include<stdio.h>
int main(){
    int a,b,c,d,e,f;
    while(~scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)){
        double y=(double)(c*d-a*f)/(double)(b*d-a*e);
        if(a!=0)
        printf("%.3f %.3f\n",(c-b*y)/a,y);
        else
        printf("%.3f %.3f\n",(f-e*y)/d,y);
    }
}

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

void solve_SE(double* x, double a, double b, double c, double d, double e, double f)
{
    x[0] = (c * e - f * b) / (a * e - d * b);
    x[1] = (c * d - f * a) / (b * d - e * a);
}

int main()
{
    double a, b, c, d, e, f;
    double x[2];
    while (cin >> a >> b >> c >> d >> e >> f) {
        solve_SE(&x[0], a, b, c, d, e, f);
        cout << x[0] << ' ' << x[1] << endl;
    }
}

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

int main(){
    	int a, b, c, d, e, f;
	double x, y;
	while(1){
	if (!(cin>>a>>b>>c>>d>>e>>f))break;
		x=(double)(1.0/(a*e-b*d))*(e*c-b*f);
		y=(double)(1.0/(a*e-b*d))*(-d*c+a*f);
		cout << (double)x << " " << (double)y << endl;
	}
	return 0;
}