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 <math.h>
using namespace std;
int main() {
	int i;
	double a[2], b[2], c[2], x, y;
	cin >> a[0] >> b[0] >> c[0] >> a[1] >> b[1] >> c[1];
	if (a[0] == 0) {
		y = c[0] / b[0];
		x = (c[1] - b[1] * y) / a[1];
	}
	else if (b[0] == 0) {
		x = c[0] / a[0];
		y = (c[1] - a[1] * x) / b[1];
	}
	else if (a[1] == 0) {
		y = c[1] / b[1];
		x = (c[0] - b[0] * y) / a[0];
	}
	else if (b[1] == 0) {
		x = c[1] / a[1];
		y = (c[0] - a[0] * x) / b[0];
	}
	else {
		x = (c[1] - c[0] * b[1] / b[0]) / (a[1] - a[0] * b[1] / b[0]);
		y = (c[0] - a[0] * x) / b[0];
	}
	x = x * 1000;
	x = round(x);
	x = x / 1000;
	y = y * 1000;
	y = round(y);
	y = y / 1000;
	cout << x << endl << y << endl;
	return 0;
}

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

using namespace std;

int main() {

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

	while(cin >> a >> b >> c >> d >> e >> f) {
	
	 float y =(float)(a*f - c*d)/(a*e - b*d);
	 float x =(float)(c*e - b*f)/(a*e - b*d);

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

    return 0;
}

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

int main()
{
	double a, b, c, d, e, f;
	while (std::cin >> a >> b >> c >> d >> e >> f) {
		double det = a * e - b * d;
		double x = (e * c - b * f) / det;
		double y = (-d * c + a * f) / det;
		std::printf("%.3f %.3f\n", x, y);
	}

	return 0;
}

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

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

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

using namespace std;


int main(){

    float a,b,c,d,e,f;
    while (scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f)!=EOF){
        float x,y;
        if (a==0)
            swap(a,d),swap(b,e),swap(c,f);

        float ratio=d/a;

        e-=ratio*b;
        f-=ratio*c;

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

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


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

C++: #include<bits/stdc++.h>
using namespace std;
const double EPS=1E-8;
typedef vector<double> vec;
typedef vector<vec> mat;

vec gauss_jordan(const mat& A,const vec& b){
  int n=A.size();
  mat B(n,vec(n+1));
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)B[i][j]=A[i][j];
  for(int i=0;i<n;i++)B[i][n]=b[i];
  for(int i=0;i<n;i++){
    int pivot=i;
    for(int j=i;j<n;j++)
      if(abs(B[j][i])>abs(B[pivot][i]))pivot=j;
    swap(B[i],B[pivot]);
    if(abs(B[i][i])<EPS)return vec();
    for(int j=i+1;j<=n;j++)B[i][j]/=B[i][i];
    for(int j=0;j<n;j++){
      if(i!=j)
	for(int k=i+1;k<=n;k++)B[j][k]-=B[j][i]*B[i][k];
    }
  }
  vec x(n);
  for(int i=0;i<n;i++)x[i]=B[i][n];
  return x;
}

int main(){
  double a,b,c,d,e,f;
  while(cin>>a>>b>>c>>d>>e>>f){
    mat A(2,vec(2));
    vec B(2);
    A[0][0]=a,A[0][1]=b;
    A[1][0]=d,A[1][1]=e;
    B[0]=c,B[1]=f;
    vec r=gauss_jordan(A,B);
    printf("%.3f %.3f\n",r[0],r[1]);
  }
  return 0;
}

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

void func(double, int);

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;
		
		func(x, -4);
		func(y, -4);
		
		if(x == 0) x = 0;
		if(y == 0) y = 0;
		
	  printf("%.3f %.3f\n", x, y);
	}

	return 0;
}

void func(double x, int n){
	
	x *= pow(10, -n-1);
	x = round(x);
	x *= pow(10, n+1);	

}

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

using namespace std;

int main(){
   double a,b,c,d,e,f;
   double x,y;
   int X,Y;
   
   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);
      
      X = static_cast<int>(x*10000);
      if(X%10>=5){
         X += 10 - (X%10);
         x = static_cast<double>(X /10000);
      }
      Y = static_cast<int>(y*10000);
      if(Y%10>=5){
         Y += 10 - (Y%10);
         y = static_cast<double>(Y /10000);
      }
      if(0 == static_cast<int>(x))
         x = 0;
      if(0 == static_cast<int>(y))
         y = 0;
      
      printf("%.3lf %.3lf\n",x,y);
      
   }
   return 0;
}

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


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

}

C++: #include<stdio.h>

int main(){
	double x1,y1,z1,x2,y2,z2,num1=0,x=0,y=0,z=0,sum1=0,sum2=0,vx=0,vy=0,vz=0;
	
	while(1){
	
	scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&z1,&x2,&y2,&z2);
	
	
	
	
	if((x1>0&&x2>0)||(x1<0&&x2>0)){
		num1=x2/x1*-1;
	}
	else if((x1>0&&x2<0)||(x1<0&&x2<0)){
		num1=x2/x1;
	}
	
	
	
	vx=x1*num1;
	vy=y1*num1;
	vz=z1*num1;
	
	x=vx+x2;
	y=vy+y2;
	z=vz+z2;
		
	sum2=z/y;
	sum1=(z2-y2*sum2)/x2;
	
	
	
	
	if(sum1>=0){
	sum1=(int)(sum1*1000+0.5);
	sum1=(double)(sum1/1000);
	}
		else if(sum1<0){
	sum1=(int)(sum1*1000-0.5);
	sum1=(double)(sum1/1000);
	}
	if(sum2>=0){
	sum2=(int)(sum2*1000+0.5);
	sum2=(double)(sum2/1000);
	}
		else if(sum2<0){
	sum2=(int)(sum2*1000-0.5);
	sum2=(double)(sum2/1000);
	}
	
	
	
	printf("%.3f %.3f\n",sum1,sum2);
	
	}
		
	return 0;
}

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

C++: #include<stdio.h>

int main(){
  int a, b, c, d, e, f;
  while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF){
    double ans1 = (double)(e*c-b*f)/(double)(a*e-b*d);
    double ans2 = (double)(-d*c+a*f)/(double)(a*e-b*d); 
    printf("%.3lf %.3lf\n", ans1, ans2);
  }
  return 0;
}

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

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

#define EPS 1.0e-6

int main(){
	int a, b, c, d, e, f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double x = 1.0*(e*c-b*f)/(e*a-b*d);
		double y = 1.0*(d*c-a*f)/(d*b-a*e);
		x += EPS;
		y += EPS;
		printf("%.3f %.3f", x, y);
		cout<<endl;
	}
	return 0;
}