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>
using namespace std;

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

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

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

}

C++: #include<iostream>

int main(int, char**)
{
	double a, b, c, d, e, f = 0;
	while (std::cin >> a >> b >> c >> d >> e >> f)
	{
		double y = (c * (a - d) - a * (c - f)) / (b * (a - d) - a * (b - e));
		printf("%.3f %.3f\n", ((c - f) - (b - e) * y) / (a - d) + 0, y + 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)){
		x= (double)(1.0/(a*e-b*d))*(e*c-b*f);
		y= (double)(1.0/(a*e-b*d))*(-d*c+a*f);
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <math.h>
//
//double cut(double d){
//    d = floor(d * 1000);
//    d = d / 1000;
//    return d;
//}

int main(int argc, const char * argv[]){
    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((-1000 > a || a > 1000) ||
           (-1000 > b || b > 1000) ||
           (-1000 > c || c > 1000) ||
           (-1000 > d || d > 1000) ||
           (-1000 > e || e > 1000) ||
           (-1000 > f || f > 1000)){
            exit(0);
        }
        x = (c * e - b * f)/(a * e - b * d);
        y = (c * d - a * f)/(b * d - a * e);
    
        printf("%.3f %.3f\n",x,y);
    }
    return 0;
}

C++: #include <stdio.h>
double round3(double a){
	a=a*10000;
	if(int(a)%10>5){
		a=a+10-int(a)%10;
	}else{
		a=a-int(a)%10;
	}
	
	a=double (int (a/10));
	a=a/1000;

	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){
			y=c/b;
			x=(f-e*y)/d;
		}else if(b==0){
			x=c/a;
			y=(f-d*x)/e;
		}else if(d==0){
			y=f/e;
			x=(c-b*y)/a;
		}else if(e==0){
			x=f/d;
			y=(c-a*x)/b;
		}else{
			y=(c*d-a*f)/(b*d-a*e);
			x=(c-b*y)/a;
		}
		
		x=round3(x);
		y=round3(y);
		
		printf("%0.3lf %0.3lf\n",x,y);
	}
	return 0;
}

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

int main(){

	double a, b, c, d, e, f, x, y, del;
	
	while(cin >> a){
	
		cin >> b >> c >> d >> e >> f;
		
		del = a * e - b * d;
		x = (c * e - b * f) / del;
		y = (a * f - c * d) / del;
		cout << fixed;
	  cout.precision(3);
	  cout << x << " " << y << endl;
	}

	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){
                x = ((e*c-b*f) / (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 <algorithm>
#include <iomanip>
#include <cmath>

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

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

double zc(double n){
        if(-0.000000001<n&&n<=0) return 0;
        else return n;
}

signed 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 = 1/(a*e-b*d)*(c*e-b*f);
                double y = 1/(a*e-b*d)*(a*f-c*d);
                printf("%.3f %.3f\n",zc(x),zc(y));
        }
        return 0;
}

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

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

using namespace std;

int main(int argc, char* argv[])
{
	double a, b, c, d, e, f;
	double b1, c1, e1, f1;
	double x, y;

	while (cin >> a >> b >> c >> d >> e >> f) {
		b1 = b * d;
		c1 = c * d;
		e1 = e * a;
		f1 = f * a;

		if (b1 == e1) continue;
		y = (c1 - f1) / (b1 - e1);
		x = (c - b * y) / a;
		printf("%.3f %.3f\n", x, y);
	}
	
	return 0;
}

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

double mround(double a){
	if(a<0.0)return a-0.0005;
	return a+0.0005;
}
int main(){
	double a[6];
	double x,y;
	while(cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4]>>a[5]){
		double b=a[1]/a[4];
		for(int i=0;i<3;i++)a[3+i]*=b;
		x=(a[2]-a[5])/(a[0]-a[3]);
		y=(a[2]-x*a[0])/a[1];

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


	return 0;
}

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

int main() {
    string line;
    while (getline(cin, line)) {
        int a, b, c, d, e, f;
        stringstream ss(line);
        ss >> a >> b >> c >> d >> e >> f;

        double x = 0.0;
        if (c*e != b*f)
            x = static_cast<double>(c*e - b*f) / (a*e - b*d);
        double y = static_cast<double>(c - a*x) / b;
        cout.precision(4);
        cout << showpoint << x << " " << y << endl;
    }
}

C++: #include <cstdio>
#include <iostream>
#include <functional>
#include <algorithm>
#include <string>
#include <cstdarg>
#include <vector>
#include <map>
#include <cmath>

using namespace std;

namespace _{struct _{_(){ // initialize
  cin.tie(0); ios::sync_with_stdio(false);
}}_;}

template <typename T, size_t size>
inline size_t len(const T (&)[size]) { return size; }
inline void println(string s) { cout << s << '\n'; }
inline string format(const char* fmt, ...){
  int size = 512;
  char* buffer = 0;
  buffer = new char[size];
  va_list vl;
  va_start(vl, fmt);
  int nsize = vsnprintf(buffer, size, fmt, vl);
  if (size <= nsize) { //fail delete buffer and try again
    delete[] buffer;
    buffer = 0;
    buffer = new char[nsize+1]; //+1 for /0
    nsize = vsnprintf(buffer, size, fmt, vl);
  }
  string ret(buffer);
  va_end(vl);
  delete[] buffer;
  return ret;
}
#define str to_string
#define rep(i, n) for (int i=0; i<int(n); i++)
#define all(c) (c).begin(), (c).end()
#define max(a, b, c) max(max((a), (b)), (c))
#define min(a, b, c) min(min((a), (b)), (c))


// ax + by = c     || ax = c - by
// dx + ey = f
// x + (b/a)y = c/a
// x + (e/d)y = f/d
// (b/a - e/d)y = c/a - f/d
// y = (c/a - f/d) / (b/a - e/d)
// x = c/a - (b/a)y
int main() {
  double a, b, c, d, e, f;
  string ret = "";
  while (cin >> a >> b >> c >> d >> e >> f) {
    double x = 0, y = 0;
    if (a == 0) {
      y = b/c;
      x = f/d - e*y/d;
    }
    else if (d == 0) {
      y = e/f;
      x = c/a - b*y/a;
    }
    else if (b == 0) {
      x = c/a;
      y = f/e - d*x/e;
    }
    else if (e == 0) {
      x = f/d;
      y = c/b - a*x/b;
    }
    else {
      y = (c/a - f/d) / (b/a - e/d);
      x = c/a - (b/a)*y;
    }

    double a = round(x * 1000);
    double b = round(y * 1000);
    ret += format("%.3f %.3f\n",a / 1000, b / 1000);
  }
  cout << ret;
}