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 <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

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

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

using namespace std;

int main(){
    int t;
    double a, b, c, d, e, f, x, y;
    cin >> t;
    while(t--){
        cin >> a >> b >> c >> d >> e >> f;
        y = (c/a - f/d)/(b/a - e/d);
        x = (c-b*y)/a;
        cout << x << " " << y << endl;
    }
    return 0;
}

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

int main() {
	double a, b, c, d, e, f;
	double x, y;
	double det;
	while (cin >> a >> b >> c >> d >> e >> f) {
		det = a * e - b * d;
		x = (e * c - b * f) / det;
		y = (-d * c + a * f) / det;
		cout << fixed << setprecision(3);
		cout << x << " " << y << endl;
	}
}

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

int main(){
	
	double a,b,c,d,e,f;
	
	while(cin >> a >> b >> c >> d >> e >> f){
		double x,y;
		
		x = ((c*e)-(b*f))/((a*e)-(b*d));
		y = ((a*f)-(c*d))/((a*e)-(b*d));
		
		cout << fixed << setprecision(3) << 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){
        y = (f*a-c*d)/(e*a-b*d);
        x = (c-b*y)/a;
        printf("%.3lf %.3lf\n",x,y);
    }
}

C++: #include <iostream>
#include <cstdio>
#define EPS 1e-10
using namespace std;

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

C++: import java.text.DecimalFormat;
import java.util.Scanner;

class Main {
public static void main(String[] args){
	Scanner scan = new Scanner(System.in);
	double a = Double.parseDouble(scan.next());
	double b = Double.parseDouble(scan.next());
	double c = Double.parseDouble(scan.next());
	double d = Double.parseDouble(scan.next());
	double e = Double.parseDouble(scan.next());
	double f = Double.parseDouble(scan.next());
	DecimalFormat df = new DecimalFormat("0.000");
	double x =(c*e-b*f)/(a*e-b*d);
	double y = (a*f-c*d)/(a*e-b*d);
	x = Math.floor((x+0.5)*1000)/1000;
	x = Math.ceil((x-0.5)*1000)/1000;
	y = Math.floor((y+0.5)*1000)/1000;
	y = Math.ceil((y-0.5)*1000)/1000;

	System.out.println(df.format(x)+" "+df.format(y) );


}
}