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

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

int main() {
  while (1) {
    if (scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f) != 6) break;

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

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

C++: #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include <algorithm>

using namespace std;

int main(){
	double a, b, c, d, e, f, x, y, x1, y1;
	while (scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=-1)
	{
		y=(f-d*c)/(a*e-b*d);
		x = (c - b*y) / a;
		y1 = round(y * 1000) / 1000;
		x1 = round(x * 1000) / 1000;
		printf("%.3f %.3f", x1, y1);
		
	}
	
	return 0;
}

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

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

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

int main(){
  int i = 0;
  while(1){
  i++;
  int a, b, c, d, e, f;
  scanf("%d ",&a);
  scanf("%d ",&b);
  scanf("%d ",&c);
  scanf("%d ",&d);
  scanf("%d ",&e);
  scanf("%d ",&f);
  
  double x, y;
  x = (double)(c*e-b*f) / (double)(a*e-b*d);
  y = (double)(a*f-c*d) / (double)(a*e-b*d);
  x = (double)round(x*10000.0) / 10000.0;
  y = (double)round(y*10000.0) / 10000.0;
  printf("%.3f %.3f\n", x, y);
  
  if(scanf("%d", &a)==EOF) break;
  else{
    int line = i * 6;
    fseek(stdin, lineL, SEEK_SET);
  }
  }
  
  return 0;
}

C++: import sys

for line in sys.stdin:
    a,b,c,d,e,f = [float(w) for w in line.split()]
    
    print("{:.3f} {:.3f}".format((e*c-b*f)/(a*e-a*b), (d*c-a*f)/(b*d-a*e)))

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

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

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

using namespace std;

int main(){
	double a, b, c, d, e, f, A, B, C, x, y;
	int xx, yy;

	while(cin >> a >> b >> c >> d >> e >> f){
		A = a * e - b * d;
		B = c * e - b * f;
		C = c * d - a * f;

		x = B / A + 0.0005;
		y = (-1) * C / A + 0.0005;
		xx = x * 1000;
		yy = y * 1000;
		x = xx * 0.001;
		y = yy * 0.001;
		printf("%.3f %.3f?\n", x, y);
	}
	return 0;
}

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

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

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 = (f-c*e/b)/(d-e*a/b);
		x = -0.001 < x && x <= -0 ? x = 0 : x;
		double y = (c-a*x)/b;
		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){
		if(e==0){
			x=d/f;
		}else{
			x=(c-b*f/e)/(a-b*d/e);
		}
		y=(c-a*x)/b;
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}