Go: package main

import "fmt"

func main() {

	for {
		var a, b, c, d, e, f float64
		var x, y float64
		i, _ := fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if i != 6 {
			return
		}

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

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

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

using namespace std;

double solutionY();
double solutionX(double);
double a1,b1,c1,d1,e1,f1;

int main(){
  while(cin >> a1 >> b1 >> c1 >> d1 >> e1 >> f1){
    double x,y;
    
    y = solutionY();
    x = solutionX(y);
    
    cout << fixed << setprecision(3) << x << " " << y << endl ;
  }
  return 0;
}

double solutionY(){
  double b,c,e,f;
  b = b1/a1;
  c = c1/a1;

  e = e1/d1;
  f = f1/d1;
  
  return (c - f)/(b - e);
}

double solutionX(double y){
  double b,c;
  b = b1/a1;
  c = c1/a1;
  
  return (c - b*y);
}

C++: #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double gcd( double m, double n );
double lcm( double m, double n );
int main(int argc, const char * argv[])
{
    double a=0.0;
    double b=0.0;
    double c=0.0;
    double d=0.0;
    double e=0.0;
    double f=0.0;
    double x=0.0;
    double y=0.0;
    int end=0;
    
    while(scanf("%d",&end)!=EOF){
        a=end;
        scanf("%lf",&b);
        scanf("%lf",&c);
        scanf("%lf",&d);
        scanf("%lf",&e);
        scanf("%lf",&f);
        double ad = lcm( a,d );
        printf("%lf\n",ad);
        
        double a2 = ad/a;
        double b2 = b*a2;
        double c2 = c*a2;
        
        double d2 = ad/d;
        double e2 = e*d2;
        double f2 = f*d2;
        
        y = (c2-f2)/(b2-e2);
        x = (c-b*y)/a;
        
        printf("%.3lf",x);
        printf(" ");
        printf("%.3lf\n",y);
        
    }
    
}
double gcd( double m, double n )
{
	if ( ( 0.0 == m ) || ( 0.0 == n ) )
		return 0;
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}

double lcm( double m, double n )
{
	if ( ( 0.0 == m ) || ( 0.0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n);
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define REP(i,N) for(int i = 0; i < (int)N; i++)

double det(double a1,double a2,double a3,double a4){
	return a1*a4-a2*a3;
}

int main(){
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double g,h,i;
		g = det(a,b,d,e);
		h = det(c,b,f,e);
		i = det(a,c,d,f);
		cout << h/g << " " << i/g << endl;
	}
	return 0;
}

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=(e*c-b*f)/(a*e-d*b);
			y=(d*c-a*f)/(d*b-a*e);

			double diff = 0.5;

			x<0?(diff=-0.5):(diff=0.5);
			x = (int)(x*1000+diff);
			
			y<0?(diff=-0.5):(diff=0.5); 
			y = (int)(y*1000+diff); 
			

			x /= 1000;y/=1000;
			

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

C++: #include<iostream>
#include<stdio.h>
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-f*a)/(b*d-e*a);
    X=(c-b*Y)/a;

    Y*=10000.0;
    if((int)Y%10>4)Y+=1.0;
    Y/=10000.0;
    X*=10000.0;
    if((int)X%10>4)X+=1.0;
    X/=10000.0;
    printf("%.3f %.3f\n",X,Y);
    
  }
  
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;


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

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

using namespace std;

int main(){
    int a, b, c, d, e, f;
    /***
    |a, b| |x| - |c|
    |d, e| |y| - |f|
     ***/
    while (cin >> a >> b >> c >> d >> e >> f) {
	int p, q, r, s;
	double det = (a*e - b*d);
	p = e;
	q = -b;
	r = -d;
	s = a;

	double x, y;
	x = (p*c + q*f) / det;
	y = (r*c + s*f) / det;
	
	printf("%.3lf %.3lf\n", x, y);
    }

    return 0;
}

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

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

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

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

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

	return 0;
}

C++: /* Simultaneous Equation */

#include <iostream>
#include <cstdio>
using namespace std;

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

    if(x == 0) x = 0.000;
    if(y == 0) y = 0.000;
    printf("%.3lf %.3lf\n", x, y);
  }

  return 0;
}

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

C++: #include<iostream>

using namespace std;

int main(){
    double 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);

        if (x == 0){ x = 0; }
        if (y == 0){ y = 0; }
        printf("%.3f %.3f\n", x, y);
    }

    return 0;
}

C++: #include <bits/stdc++.h>
// #include "bits/stdc++.h"

#define pout(n)  printf ("%d\n", n)

#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)

const int d4x[4] = {1, 0, -1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 };
 
typedef long long ll;
using namespace std;
 
int main() {
  double a,b,c,d,e,f,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\n",x,y);
  return 0;
}

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

int main(){
	int count = 0;
	double x[100],y[100];
	double a, b, c, d, e, f;
	while(cin >> a >> b >> e >> c >> d >> f){
		x[count] = (e*d-b*f)/(a*d-b*c);
		y[count] = (a*f-e*c)/(a*d-b*c);
		count++;
	}
	for(int i = 0; i < count; i++){
		cout << x[i] << " " << y[i] << endl;
	}
}