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<stdio.h>
int main(){
  int a,b,c,d,e,f;
  double x,y;
  while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){
  y=(c*d-f*a)/(b*d-e*a);
  x=(c-(b*y))/a;
  printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

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

int main() {
  int a, b, c, d, e, f;
  std::cout.precision(3);
  std::cout << std::fixed;
  while (!std::cin.eof()) {
    std::cin >> a >> b >> e >> c >> d >> f;

    double factor = a * d - b * c;
    double x = ( d * e + -b * f) / factor;
    double y = (-c * e +  a * f) / factor;
    std::cout << x << ' ' << y << std::endl;

    while (isspace(std::cin.peek())) { std::cin.ignore(); }
  }
}

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

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

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

int main()
{
    using namespace std;
    typedef struct {
        double x;
        double y;
    } xy;
    double a, b, c, d, e, f, x, y;
    vector<xy> results;
    
    cout.precision(3);
    cout << fixed << showpoint;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double coef = d/a;
        b *= coef; c *= coef;
        y = (c - f)/(b - e);
        x = (f - e*y)/d;
        x = round(x*1000.0)/1000.0;
        y = round(y*1000.0)/1000.0;
        if (x == 0) x = fabs(x);
        if (y == 0) y = fabs(y);
        results.push_back( {x,y} );
        // cout << x << " " << y << endl;
    }
    for (vector<xy>::iterator itr = results.begin();
         itr != results.end(); ++itr) {
        // xy& tmp = *itr;
        cout << itr->x << " " << itr->y << endl;
    }
}

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

using namespace std;

int main() {
	int i=0;
	int a[10000], b[10000], c[10000], d[10000], e[10000], f[10000];
	while (1) {
		cin >> a[i] >> b[i] >> c[i] >> d[i] >> e[i] >> f[i];
		if (a[i] == 0 && b[i] == 0 && c[i] == 0 && d[i] == 0 && e[i] == 0 && f[i] == 0)break;
		i++;
	}
	int x[10000], y[10000];
	for (int j = 0; j < i; j++) {
		y[j] = (double)(c[j] * d[j] - a[j] * f[j]) / (double)(b[j] * d[j] - a[j] * e[j]);
		x[j] = (double)(c[j] * e[j] - b[j] * f[j]) / (double)(a[j] * e[j] - b[j] * d[j]);
		printf("%d.3f %d.3f\n", x[j], y[j]);
	}
	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 = (c * e - b * f) / (a * e - b * d);
        double y = (c * d - a * f) / (b * d - a * e);

        if (x == 0) x = 0;
        if (y == 0) y = 0;

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

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

double* solve_equations(double *a)
{
	// クラメルの公式を用いる
	int data_size=sizeof(a[0]);
	/*cout << "data_size=" << data_size << endl;
	cout << "a=" << a << endl;
	cout << "*(a + data_size*1)=" << *(a + 1) << endl;
	cout << "*(a + data_size*0) * *(a + data_size*4)" << *(a + data_size*0) * *(a + data_size*4) << endl; */
	double z = *(a + 0) * *(a + 4) 
		   - *(a + 1) * *(a + 3);
	double x = *(a + 2) * *(a + 4)
		   -	*(a + 1) * *(a + 5);
	double y = *(a + 0) * *(a + 5)
		   - *(a + 2) * *(a + 3); 
	double ax,ay;
	/*cout << "x=" << x << endl;
	cout << "y=" << y << endl;*/
	ax = pow(z,-1)*x;
	ay = pow(z,-1)*y;
	
	/* cout << ax << endl;
	cout << ay << endl; */
	double ans[2] = {ax,ay};
	return ans;
}

int main()
{
	double n[6];
	double s;
	int i=0;
	while (cin >> s){
		if (i == 5){
			n[i]=s;
			/* for (int j=0;j<=5;j++)
			{
				cout << "n[" << j << "]=" << n[j] << endl;
			}*/
			double* an;
			an = solve_equations(n);
			/* printf("%.3lf",*(an+0));
			cout << " " << endl;
			printf("%.3lf",*(an+1)); */
			if (an[1] == 0)
				cout << fixed << setprecision(3) << an[0] << " " << 0.000 << endl;
			else if(an[0] == 0)
				cout << fixed << setprecision(3) << 0.000 << " " << an[1] << endl;
			else
				cout << fixed << setprecision(3) << an[0] << " " << an[1] << endl;

			i = 0;}
		else{
			n[i]=s;
			i++;
		}
	}
	return 0;
			// cout << l[0]  endl;
}

C++: #include<stdio.h>

int main(){

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

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

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

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

int main(void)
{
	double a,b,c,d,e,f;
	double ans[2];

	cin >> a >> b >> c >> d >> e >> f;

	ans[1] = (c*d-a*f)/(b*d-a*e);
	ans[0] = (c*d-b*d*ans[1])/(a*d);

	printf("%.3lf %.3lf\n", ans[0]+0.0005,ans[1]+0.0005);

	return 0;
}

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

int main(void) {
    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("%.3lf %.3lf", x, y);
        cout << endl;
    }
}

C++: #include <iostream>

using namespace std;

int main()
{
	int a,b,c,d,e,f;
	float x,y,dx,dy;
	while( cin >> a >> b >>c >>d >> e >> f ) {
		x = (c*e-b*f)/(float)(a*e-b*d);
		y = (c - a*x)/(float)b;
		
		x += 0.0005;
		y += 0.0005;

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



	return 0;
}

C++: #include <iomanip>
#include <utility>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;

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

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

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

C++: #include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
	int a,b,c,d,e,f;
	int o,p,q,r,s,t;
	float x,y;
	while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)!=EOF){
		o=a;p=b;q=c;r=d;s=e;t=f;
		o*=d;p*=d;q*=d;
		r*=a;s*=a;t*=a;
		//printf("%d %d %d %d %d %d \n",o,p,q,r,s,t);
		p-=s;
		q-=t;
		if(q==0){
			y=0.0;
		}
		else{
		y=(float)(q/p);
		}
		int g=(int)(e*y);
		g*=-1;
		if(f+g==0){
			x=0.0;
		}
		else{
			x=(float)((f+g)/d);
		}
		printf("%.3f %.3f\n",x,y);
	}
}

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

	cout << fixed << setprecision(3) << ((c*e-b*f)/(a*e-b*d))  << " " << (a*f-c*d)/((a*e-b*d)) << endl;
	
	}

	return 0;
}

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