Go: package main

import "fmt"

func main() {
	var resultX, resultY [100]float32
	var count 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
		}
		//Simultaneous equation
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		resultX[count] = x
		resultY[count] = y
		count++
	}
	for i := 0; i < count; i++ {
		fmt.Printf("%.3f %.3f\n", resultX[i], resultY[i])
	}
}

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




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

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<sstream>
#include<iomanip>
#include<cstdlib>
#include<cmath>
#include<cstdio>
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 = fabs(x);
		if (y == 0)y = fabs(y);
		cout << fixed << setprecision(3) << x << " ";
		cout << fixed << setprecision(3) << y << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <utility>
using namespace std;
typedef pair<double, double> PDD;
PDD calc(double mat[2][2], double vec[2]){
  double a = mat[0][0], b = mat[0][1], d = mat[1][0], e = mat[1][1];
  double c = vec[0], f = vec[1];
  double det = a * e - d * b;
  return make_pair((e * c - b * f) / det, (-c * d + a * f) / det);
}
int main(){
  double mat[2][2];
  double vec[2];
  while(cin >> mat[0][0] >> mat[0][1] >> vec[0] >> mat[1][0] >> mat[1][1] >> vec[1]){
    PDD res = calc(mat, vec);
    double x = (double)(round(res.first*100))/100.0, y = (double)(round(res.second*100))/100.0;
    printf("%.3f %.3f\n", x, y);
  }
  return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
int main() {
 int cn=0,i;
 double a,b,c,d,e,f;
 vector<double> x,y;
 while(cin >> a >> b >> c >> d >> e >> f) {
	 y.push_back((c-f*a/d)/(b-e*a/d));
	 x.push_back((c-f*b/e)/(a-d*b/e));
	 cn++;
	 }
 for (i=0;i<cn;i++) printf("%.3f %.3f\n",x[i],y[i]); 
 return 0;
}

C++: #include <stdio.h>

#define X 0
#define Y 1
#define C 2
#define SIKI1 0
#define SIKI2 1
#define LEFT  0
#define RIGHT 1

int main(){
	double A[3][3][3];
	int n[6];

	while( scanf("%d %d %d %d %d %d",&n[0],&n[1],&n[2],&n[3],&n[4],&n[5]) != EOF){
		//ÏÌú»
		for(int i=0 ; i<=RIGHT ; i++){
			for(int j=0 ; j<=SIKI2 ; j++){
				for(int k=0 ; k<=C ; k++){
					A[i][j][k] = 0;
				}
			}
		}

		//lÌãü
		A[LEFT][SIKI1][X]  = n[0];
		A[LEFT][SIKI1][Y]  = n[1];
		A[RIGHT][SIKI1][C] = n[2];
		A[LEFT][SIKI2][X]  = n[3];
		A[LEFT][SIKI2][Y]  = n[4];
		A[RIGHT][SIKI2][C] = n[5];

		//®PÌXð¶Ó©çEÓÖÚ·é
		A[ RIGHT ][ SIKI1 ][ X ]  += (-1.0)*(A[ LEFT ][ SIKI1 ][ X ]);
		A[ LEFT  ][ SIKI1 ][ X ]  = 0;

		//®PÌ¼ÓðYÌWÅé		
		A[ RIGHT ][ SIKI1 ][ X ]  /= A[ LEFT ][ SIKI1 ][ Y ];
		A[ RIGHT ][ SIKI1 ][ C ]  /= A[ LEFT ][ SIKI1 ][ Y ];
		A[ LEFT  ][ SIKI1 ][ Y ]  = 1;

		//®QÌYÉãüµÄ®Qð(ax = b)Ì`É·é
		int a = A[ LEFT ][ SIKI2 ][ Y ];
		A[ LEFT  ][ SIKI2 ][ X ]  += a * A[ RIGHT ][ SIKI1 ][ X ];
		A[ LEFT  ][ SIKI2 ][ Y ]   = 0;
		A[ RIGHT ][ SIKI2 ][ C ]  += a * A[ RIGHT ][ SIKI1 ][ C ] * (-1.0);
		//XYÌðªÜé
		double answerX = A[ RIGHT ][ SIKI2 ][ C ] / A[ LEFT ][ SIKI2 ][ X ];
		double answerY = (n[2] + n[0]*answerX*(-1.0))/n[1];
		
		//¬æSÊðlÌÜü·é
		if( (((int)(answerX*10000))%10) >= 5){
			answerX += 0.001;
		}
		if( (((int)(answerY*10000))%10) >= 5){
			answerY += 0.001;
		}
		if(answerX==-0.0){
			answerX = 0;
		}
		//ðÌoÍ
		printf("%.6f %.6f\n", answerX , answerY);
	}

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

	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>
float round3(float a){
	a=a*10000;
	if(int(a)%10>5)a=a+10;
	a=float (int (a));
	a=a/10000;
	return a;

}
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){
		if(a!=0.0){
		  y=(f-c*d/a)/(e-b*d/a);
		  x=(c-b*y)/a;
		}
		else if(d!=0.0 && b!=0.0){
		  y=c/b;
		  x=(f-e*y)/d;
		}
		else if(d==0.0){
		  x=0.0;
		  if(b!=0.0) y=c/b;
		  else if(e!=0.0) y=f/e;
		}

		x=round3(x);
		y=round3(y);
		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(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 - b*y)/a);
                    cout<<fixed<<setprecision(3)<<x<<" ";
                    cout<<fixed<<setprecision(3)<<y<<endl;
          }

return 0;
}

C++: //A§ûö®
//ax + by = c
//dx + ey = f
//ÌððoÍ¹æ@È¨AðÍêÓÉèÜéàÌÆ·é

//üÍÍÀa`fªóÅæØçêÄ^¦çêéiIíèÍHj
//oÍÍxAyðóÅæØÁÄA¬_æ4ðlÌÜüµ½lðoÍ¹æ



#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;


void Round(double &refX)
{
	//ë·@¡ñÍ¬_Èºæ4ÅlÌÜüÆ
	const double eps = 0.001;
	if( abs(refX) < eps)
		refX = 0;
}

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

		
		//ax+by=c
		//dx+ey=f

		//d(ax+by=c)
		//a(dx+ey=f)
		//ãÓ[ºÓÅ
		//(bd-ae)y=dc-af
		//æÁÄy = (cd-af) / (bd-ae)

		//¯¶­
		//e(ax+by=c)
		//b(dx+ef=f)
		//ãÓ[ºÓÅ
		//(ae-bd)x=ce-bf
		//æÁÄx = (ce-bf) / (ae-bd)

		if(a*e == b*d)
		{
			cout << "ðªêÓÉèÜèÜ¹ñ" << endl;
			continue;
		}

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

		//-0Æ©oé±Æª Á½©çÛßé
		Round(x);
		Round(y);

		//¬_Èºà\¦·éæ¤ÉµA¬_æ4ðlÌÜü·é
		cout << setprecision(3);
		cout << setiosflags(ios::fixed);

		cout << x << ' ';
		cout << y << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<string>

#define add push_back
#define inf 2147000000

#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main(void){
	double a,b,c,d,e,f,g,h,i,x=0,y=0;
	
	while(scanf("%lf",&a)!=EOF){
		scanf("%lf%lf%lf%lf%lf",&b,&c,&d,&e,&f);
		
		
		g=a/d;
		d*=g;
		e*=g;
		f*=g;
		
		h=b-e;
		i=c-f;
		
		x=i/h;
		h=a;
		i=c-b*x;
		y=i/h;
		
		printf("%.3lf %.3lf\n",y,x);
	}
}

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

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