Go: package main

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

func main() {
        var a, b, c, d, e, f float64
        sc := bufio.NewScanner(os.Stdin)
        for sc.Scan() {
                fmt.Sscanf(sc.Text(), "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)

                det := a*e - b*d
                x := (e*c - b*f) / det
                y := (a*f - c*d) / det
                if x == 0.0 {
                        x = math.Abs(x)
                }
                if y == 0.0 {
                        y = math.Abs(y)
                }
                fmt.Printf("%.3f %.3f\n", x, y)
        }
}

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

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

C++: #include <cstdio>

int main(){
	int p1[5],p2[5],a[5];
	float h[5];

	while(scanf("%d %d %d %d %d %d",&p1[1],&p1[2],&p1[3],&p2[1],&p2[2],&p2[3])!=EOF){
		p1[2] = p1[2]*p2[1];
		p1[3] = p1[3]*p2[1];

		p2[2] = p2[2]*p1[1];
		p2[3] = p2[3]*p1[1];

		p1[1] = p1[1]*p2[1];

		a[1] = p1[2]-p2[2];
		a[2] = p1[3]-p2[3];

		h[2] = a[2]/a[1];

		if(p1[2]*h[2] <= 0)
		{
			h[1] = (p1[3]+(p1[2]*h[2]))/p1[1];
		}else if(p1[2]*h[2] >= 0)
		{
			h[1] = (p1[3]-(p1[2]*h[2]))/p1[1];
		}

		printf("%.3f %.3f\n", h[1],h[2]);
	}
}

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

using namespace std;

int main() {

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


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

			aa=(c*e-b*f)/(a*e-b*d);
	bb=(a*f-c*d)/(a*e-b*d);

	//cout << fixed << setprecision(3) << ((c*e-b*f)/(a*e-b*d))  << " " << ((a*f-c*d)/(a*e-b*d)) << endl;


		printf("%03d %*s %03d",	aa,1,bb);
	
	}

	return 0;
}

C++: //
//  main.cpp
//  b
//
//  Created by h3037178 on 2017/07/31.
//  Copyright ?? 2017??´ ?????£?????????. All rights reserved.
//

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

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

int main(){
	
	double a, b, c, d, e, f;
	// input
	while(std::cin >> a >> b >> c >> d >> e >> f){
		
		/*	solve the equation
		*	y = (f - d*x) / e
		*	x = (c*e - b*f) / (a*e - b*d)
		*/
		double x = (c*e - b*f) / (a*e - b*d);
		double y = (f - d*x) / e;
		// output
		std::cout << std::fixed << std::setprecision(3) <<  x << " " << y << std::endl;
	}
	
	return 0;
}

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

#define N 2

using namespace std;

int main(){
	double a[N][N+1];
	double d;
	int i, j, k;
	bool flag = 1;

	while(cin >> a[0][0] >> a[0][1] >> a[0][2] >> a[1][0] >> a[1][1] >> a[1][2]){
		for(k = 0; k < N - 1; k++){
			for(i = k+1; i < N; i++){
				d = a[i][k] / a[k][k];
				for(j = k + 1; j <= N; j++){
					a[i][j] = a[i][j] - a[k][j] * d;
				}
			}
		}
		for(i = N - 1; i >= 0; i--){
			d = a[i][N];
			for(j = i + 1; j < N; j++){
				d = d - a[i][j] * a[j][N];
			}
			a[i][N] = d / a[i][i];
		}
		printf("%.3lf %.3lf", a[0][N], a[1][N]);
	}
	return 0;
}

C++: #include<stdio.h>

int main(void)
{
	int a,b,c,d,e,f;
	while(scanf("%d%d%d%d%d%d\n",&a,&b,&c,&d,&e,&f) != EOF){
	
	double y = ((c*d-a*f)/(b*d-a*e));
	double x = ((c-b*y)/a);
	
	printf("%0.3f %0.3f\n", (double)x,(double)y);
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>




void main(void) {
	printf("a,b,c,d,e,f??????????????????????????§??\?????????????????????\n");
	double a=0, b=0, c=0, d=0, e=0, f=0;
	scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
	double x = (f*b - e*c) / (d*b - e*a);
	double y = (f*a - d*c) / (e*a - d*b);
	printf("%f %f\n", x, y);
	return;
}

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

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

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

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

using namespace std;
double sg(double n); 
int main()
{
	int a[1000],b[1000],c[1000],d[1000],e[1000],f[1000];
	float x[1000],y[1000];
	int w_x,w_y;
	int len=0;
	while (cin >> a[len] >> b[len] >> c[len] >> d[len] >> e[len] >> f[len])
		len++;

	for (int i=0; i < len; i++) {
		x[i] =  ((e[i] * c[i] - b[i] * f[i]) / (e[i] * a[i] - b[i] * d[i]));
		y[i] =  ((c[i] * d[i] - f[i] * a[i]) / (b[i] * d[i] - a[i] * e[i]));
	}
	for (int i=0; i < len; i++) {
		printf("%.3lf %.3lf\n",sg(x[i]),sg(y[i]));
	}
	return 0;
}
double sg(double n)
{
	int w;
	n = n * 10000;
	w = (int)n % 10;
	n /= 10000;
	if (w > 4) 
		n += 0.001;
	return n;
}

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);
  printf("%0.3f %0.3f\n",x,y);
 }
}

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

using namespace std;

int main(){
  double a,b,c,d,e,f;
  vector<double> al,bl,cl,dl,el,fl;
  double x,y,n,m;

  while(cin >> a >> b >> c >> d >> e >> f){
    al.push_back(a);
    bl.push_back(b);
    cl.push_back(c);
    dl.push_back(d);
    el.push_back(e);
    fl.push_back(f);
  }

  for(int i=0; i<al.size(); i++){
    n = bl[i]/el[i];
    m = al[i]/dl[i];
    x = (cl[i]-n*fl[i])/(al[i]-n*dl[i]); 
    y = (cl[i]-m*fl[i])/(bl[i]-m*el[i]);
    cout << setprecision(3) << fixed << y << " " << x << endl;
  }

  return 0;
}