Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanLines)
	for sc.Scan() {
		s := strings.Split(sc.Text(), " ")
		a, _ := strconv.ParseFloat(s[0], 64)
		b, _ := strconv.ParseFloat(s[1], 64)
		c, _ := strconv.ParseFloat(s[2], 64)
		d, _ := strconv.ParseFloat(s[3], 64)
		e, _ := strconv.ParseFloat(s[4], 64)
		f, _ := strconv.ParseFloat(s[5], 64)
		x := ((b * f) - (c * e)) / ((b * d) - (a * e))
		y := ((a * f) - (c * d)) / ((a * e) - (b * d))
		if x == 0 {
			fmt.Printf("0.000 %.3f\n", y)
		} else if y == 0 {
			fmt.Printf("%.3f 0.000\n", x)
		} else {
			fmt.Printf("%.3f %.3f\n", x, y)
		}
	}
}

C++: #include<stdio.h>
int main(void)
{
	float e2,f2,c2;
	float a1,b1,c1,d1,e1,f1;
	float a,b,c,d,e,f;
	float add,x,y;
	while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF){
		if(a==0||d==0){
			printf("0.000 0.000\n");
			continue;
		}
		else{
			add=a/d;
		}
		a1=a;
		b1=b;
		c1=c;
		d1=d*add;
		e1=e*add;
		f1=f*add;
		e2=b-e1;
		f2=c-f1;
		if(f2==0||e2==0){
			printf("0.000 0.000\n");
			continue;
		}
		else{
			y=f2/e2;
		}
		add=b/e;
		a1=a;
		b1=b;
		c1=c;
		d1=d*add;
		e1=e*add;
		f1=f*add;
		a1=a-d1;
		c2=c-f1;
		x=c2/a1;
		printf("%0.3f %0.3f\n",x,y);
	}
	return 0;
}
/*
1x+2y=3
4x+5y=6
a  b  c
1x+2y=3;
1.6x+2y=1.2
d    e   f
-0.4x=1.8
*/

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

int main() {
  double m[2][3], x[2];
  double a, b, c, d, e, f;
  int p, q;
  bool zf;
  while (cin>>m[0][0]>>m[0][1]>>m[0][2]>>m[1][0]>>m[1][1]>>m[1][2]) {
    zf = false;
    for (int i=0;i<2;i++) {
      for (int j=0;j<2;j++) {
        if (m[i][j] == 0) {
          p = i; q = j;
          zf = true;
        }
      }
    }
    if (zf) {
      x[1-q] = m[p][2] / m[p][1-q];
      x[q] = (m[1-p][2] - m[1-p][1-q] * x[1-q]) / m[1-p][q];
    } else {
      a = m[0][0]; b = m[0][1]; c = m[0][2];
      d = m[1][0]; e = m[1][1]; f = m[1][2];
      x[1] = (f - d*c/a) / (e - d*b/a);
      x[0] = (c - b*x[1]) / a;
    }

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

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

int main(void) {
	float a,b,c,d,e,f;
	
	while(scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f) != EOF){
		float by = d/a,x,y;
		y = (c*by-f)/(b*by-e);
		x = (c - b*y)/a;
		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;
	cout<<setprecision(3);
	cout<<fixed;
	while(cin>>a>>b>>c>>d>>e>>f){
		x=1.0/(a*e-b*d)*(e*c-b*f);
		y=1.0/(a*e-b*d)*(a*f-d*c);
		if(-0.0005<=x && x<=0)x=0;
		if(-0.0005<=y && y<=0)y=0;
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

C++: #include <stdio.h>

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

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

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<iomanip>
using namespace std;
int main(){
	while (true) {
		double a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if (cin.eof()) break;
		double x = (b * f - e * c) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);
		cout << setprecision(3) << fixed << x << " " << y << "\n";
	}
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <complex>
#include <iterator>
using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;

#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(auto i = (c).rbegin(); i != (c).rend(); i++)
#define repfn(i, a, cont, next) \
  for(auto i = (a); [=](){return(cont);}(); i = [=](){return(next);}())
#define repby(i, a, b, step) repfn(i, a, i < b, i + step)
#define repab(i, a, b) repby(i, (a), (b), 1)
#define rep(i, n) repab(i, 0, (n))
#define pb push_back
#define sz(c) int((c).size())

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

C++: #include<stdio.h>

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

int main()
{
	while ( scanf ( "%d %d %d %d %d %d" , &a , &b , &c , &d , &e , &f ) == 6 ) {
		y = (c*a-f*a)/(b*a-e*a) ;
		x = ( c - b*(c*a-f*a)/(b*a-e*a) ) / a ;
		printf ( "%.3llf %.3llf\n" , x , y ) ;
	}
	return 0 ;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(void){
    int a,b,c,d,e,f;
    double x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        x=(b*f-c*e)/(b*d-a*e);
        y = (a*f-c*d)/(a*e-b*d);
        if(x == 0) x = 0;
        if(y == 0) y = 0;
        cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
    }
    return 0;
}

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

int main(){
	int i = 0;
	double a, b, c, d, e, f;
	double x[2], y[2];
	while (i<=1){
		cin >> a >> b >> c >> d >> e >> f;
		x[i] = (c*e - f*b) / (a*e - b*d);
		y[i] = (c - a*x[i])/b;
		i++;
	}
	for (int j = 0; j < 2; j++){
		cout << fixed << setprecision(3) << x[j]+0.0001 << " " << setprecision(3) << y[j] +0.0001<< '\n';
	}

	return 0;
}

C++: #include<stdio.h>
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)!=-1){
		x=((c*e-f*b)/(a*e-d*b));
		y=((c-a*x)/b);
		if(x>0)x+=0.0005;
		else x-=0.0005;
		if(y>0)x+=0.0005;
		else y=-0.0005;
		printf("%.3lf %.3lf",x,y);
	}
	return 0;
}

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

int main(){

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

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

    printf("%.3lf %.3lf\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);
		}
		x+=0.0005;
		y+=0.0005;
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}