Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextFloat64() (float64, error) {
	return strconv.ParseFloat(nextString(), 64)
}

func mathRound(f float64) float64 {
	return math.Floor(f + .5)
}

func round(x float64) float64 {
	if math.Abs(x) < 0.001 {
		return 0
	}
	return mathRound(x*1000) / 1000
}

func main() {
	scanner.Split(bufio.ScanWords)
	for {
		a, err := nextFloat64()
		if err != nil {
			break
		}
		b, _ := nextFloat64()
		c, _ := nextFloat64()
		d, _ := nextFloat64()
		e, _ := nextFloat64()
		f, _ := nextFloat64()

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

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

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){
        printf("%.3f ",(c-b*(f-d*c/a)/(e-d*b/a))/a);
        printf("%.3f\n",(f-d*c/a)/(e-d*b/a));
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	double a,b,c,d,e,f,g;
	double x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		g=a*e-b*d;
		x=(c*e-b*f)/g;if(!x)x=0;
		y=(a*f-c*d)/g;if(!y)y=0;
		printf("%.3f %.3f",x,y);
	}
}

C++: #include<cstdio>
#include<string>
#include<iostream>
#include<algorithm>
#define _USE_MATH_DEFINES
#include<math.h>
#include<queue>
#include<set>
#include<vector>
#define INF 100000000

#define MAX_N 100
#define MAX_set 200

typedef long long int ll;
using namespace std;


int main(){

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

	while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF){

		double x = (e*c-b*f)/(e*a-b*d);
	
		printf("%.3f %.3f\n", x, (c-a*x)/b);
	
	
	
	}

}

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

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

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

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



int main(){
  double a,b,c,d,e,f;
  while(cin >> a >> b >> c >> d >> e >> f)
    cout << double( (c*e-f*b)/(a*e-b*d))<< ' ' << double((a*f-c*d)  /(a*e-b*d)) <<endl;

}

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

int main(){
	double a[6];
	double x,y;
	while(true){
		cin >> a[0];
		cin >> a[1];
		cin >> a[2];
		cin >> a[3];
		cin >> a[4];
		cin >> a[5];
		if(cin.eof())
			break;
			
		x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		
		cout << setprecision(3) << x << " " <<setprecision(3) << y << endl;
	}
	return 0;
}

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

int main(void) {
  string input;
  string output;
  vector<string> v;
  float a, b, c, d, e, f;
  while (scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)+1)  {
    float x = (c*e-b*f)/(a*e-b*d);
    float y = (c*d-a*f)/(b*d-a*e);
    if (x < -1.0e-4) x = 0.0;
    if (y < -1.0e-4) y = 0.0;
    printf("%.3f %.3f\n", x, y);
  }
  return 0;
}

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

float det(float a[2][2]){
	return a[0][0]*a[1][1]-a[0][1]*a[1][0];
}
float detx(float a[2][2],float p,float q){
	return p*a[1][1]-a[0][1]*q;
}
float dety(float a[2][2],float p,float q){
	return a[0][0]*q-p*a[1][0];
}

int main(){
	float a[2][2];
	float p,q;

	while(cin>>a[0][0]>>a[0][1]>>p>>a[1][0]>>a[1][1]>>q){
		float d1;
		float x,y;
		d1=det(a);
		x=detx(a,p,q)/d1;
		if(x==-0) x=0;
		y=dety(a,p,q)/d1;
		if(y==-0) y=0;
		cout.precision(3);
		cout.setf(ios::fixed);
		cout<<x<<" "<<y<<"\n";
	}
	return 0;
}

C++: #include <stdio.h>

int main(void){
	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=(f-((c*d)/a))/(-((b*d)/a)+e);
		x=(c-(b*y))/a;
		if(((y+0.0005)/0.001)==0){
			y=0;
		}
		if(((x+0.0005)/0.001)==0){
			x=0;
		}
		printf("%.3f %.3f\n",x,y);
	}
}

C++: #include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
	long a,b,c,d,e,f;
	long o,p,q,r,s,t;
	double x,y;
	while(scanf("%ld%ld%ld%ld%ld%ld",&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("%.3lf %.3lf\n",x,y);
	}
}

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

int main() {
	// your code goes here

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

  while(cin >> a >> b >> c >> d >> e >> f ){

    x =(double)((e*c-b*f)/(a*e-b*d));
    y = (double)((-(d*c)+a*f)/(a*e-b*d));
    if(y == 0){
      y = 0;
    }


    if(x == 0){
      x = 0;
    }

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

C++: #include <cstdio>

#define MAX(a, b)((a) < (b) ? (b) : (a))
#define MIN(a, b)((a) < (b) ? (a) : (b))

using namespace std;

int LCM(int x, int y)
{
    int bigger = MAX(x, y);
    int smaller = MIN(x, y);
    int i = 2;
    int j = 2;
    
    if ((smaller * i) % bigger == 0) return bigger;
    
    while ((smaller * i) % bigger != 0) {
        if (bigger < (smaller * i)) {
            bigger *= j;
            
            j++;
        }
        
        i++;
    }
    
    return bigger;
}

int main() {
	int a, b, c, d, e, f;
	int _a, _b, _c, _d, _e, _f;
	double x, y;
	int _x, _y, _z;
	int multiTop, multiBottom;
	int common;
	
	while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) {
	    common = LCM(a, d);
	    multiTop = common / a;
	    multiBottom = common / d;
	    
	    _a = common;
	    _b = b * multiTop;
	    _c = c * multiTop;
	    
	    _d = common;
	    _e = e * -multiBottom;
	    _f = f * -multiBottom;
	    
	    _y = _b + _e;
	    _z = _c + _f;
	    
	    y = (double)_z / (double)_y;
	    
	    _c = c - (b * y);
	    
	    x = (double)_c / (double)a;
	    
	    printf("%.3f %.3f\n", x, y);
	}
	
	return 0;
}

C++: //Simulataneous Equation
#include<bits/stdc++.h>
using namespace std;

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), (c*d-a*f)/(b*d-a*e));
  }
  return 0;
}

C++: #include<iostream>
#include<math.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main(){
    double a,b,c,d,e,f,x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
    x=(e*c-f*b)/(a*e-b*d);
    y=(-(d*c)+a*f)/(a*e-b*d);
    if(x==0){
        x=0;
    }
    if(y==0){
        y=0;
    }
    printf("%.3f %.3f\n",x,y);
    return 0;
    }
}

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

using namespace std;

int main (int argc, char const* argv[])
{
    double a,b,c,d,e,f;
    double x,y;
    
    while(cin >> a >> b >> c >> d >> e >> f){
        if(!a && !b && !c && !d && !e && !f){
            x = (c*e - b*f) / (a*e - b*d);
            y = (c - a*x)/b;
        }

        if(!a){
            y = c/b;
            x = !e ? x = f/d : (f - e*y)/d;
        }

        if(!b){
            x = c/a;
            y = !d ? f/e : (f - d*x)/e;
        }

        if(!d){
            y = f/e;
            x = !b ? c/a : (c-e*y)/a;
        }

        if(!e){
            x = f/x;
            y = !a ? c/b : (c-a*x)/b;
        }

        x = round(x * 1000)/1000.0;
        y = round(y * 1000)/1000.0;
        
        printf("%.03lf %.03lf\n",x,y);
    }
    
    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;

			if(x / 10000 >= 5){
				x += 0.001;
			}if(y / 10000 >= 5){
				y += 0.001;
			}

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