Go: package main

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

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		strNums := strings.Fields(scanner.Text())
		nums := []int{}
		for _, strNum := range strNums {
			num, _ := strconv.Atoi(strNum)
			nums = append(nums, num)
		}
		a := nums[0]
		b := nums[1]
		c := nums[2]
		d := nums[3]
		e := nums[4]
		f := nums[5]
		lcm := lcm(a, d)
		mulA := lcm / a
		mulD := lcm / d
		a *= mulA
		b *= mulA
		c *= mulA
		d *= mulD
		e *= mulD
		f *= mulD

		if d < 0 {
			d *= -1
			e *= -1
			f *= -1
		}

		bE := b - e
		cF := c - f
		y := float64(cF) / float64(bE)
		x := (float64(c) - (y * float64(b))) / float64(a)

		if x == 0 {
			fmt.Printf("%.3f ", 0.0)
		} else {
			fmt.Printf("%.3f ", x)
		}
		if y == 0 {
			fmt.Printf("%.3f\n", 0.0)
		} else {
			fmt.Printf("%.3f\n", y)
		}
	}
}

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

int main(){

    double a,b,c,d,e,f,y,x,bb,cc,dd,ee,ff;
    while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
        bb=b/a;
        cc=c/a;
        ee=e/d;
        ff=f/d;
        y=(cc-ff)/(bb-ee);
        x=(c-b*y)/a;
        x+=0.0004;
        y+=0.0004;
        printf("%.3lf %.3lf\n",x,y);
    
        /*
        y=round(1000*y);
        y=(int)y;
        y=y/1000+0.0;
        
        x=round(1000*x);
        x=(int)x;
        x=x/1000+0.0;
        cout<<fixed<<setprecision( 3 )<<x<<" "<<y<<endl;*/
        //printf("%f %f\n",x,y);
    }
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#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*e - b*f) / (a*e - b*d);
		double y = (c*d - a*f) / (b*d - a*e);

		printf("%.3f %.3f\n", x + 0.0, y + 0.0);
	}
	
	return 0;
}

C++: #include<stdio.h>
int main(void){
	int a,b,c,d,e,f;
	while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)){
	double y=(c*d-a*f)/(b*d-a*e);
	double x=(a*e-b*d)/(c*e-b*f);
		if(b*d-a*e==0)y=0;
		if(c*e-b*f==0)x=0;
	printf("%.3f %.3f\n",((int) x*10000%10<5)?x:x+0.001,((int)y*10000%10<5)?y:y+0.001);
	}
	return 0;
}

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


double a,b,c,d,e,f;
double A,B;//x,y座標
int main(){
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) !=EOF){
    
    if(a*e-b*d != 0){
    B =(c*e-f*b)/(a*e-b*d);
    A =(c -b*B)/a;
    }
    
    if(A > 0){
    A =round((A+0.0005)*1000)/1000;
    }else if(A < 0){
    A =round((A-0.0005)*1000)/1000;
    }
    if(B > 0){//小数第4位を四捨五入
    B =round((B+0.0005)*1000)/1000;
    }else if(B <0){
    B =round((B-0.0005)*1000)/1000;
    }
    printf("%.3f %.3f\n",B,A);
  }
  return 0;
}

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

C++: #include<cstdio>

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

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

C++: #include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <limits>
#include <sstream>
#include <iomanip>

using namespace std;

int main (void)
{
	int 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 << " " << fixed << setprecision(3) << y << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <cassert>
using namespace std;

#define GET_ARG(a,b,c,F,...) F
#define REP3(i,s,e) for (i = s; i <= e; i++)
#define REP2(i,n) REP3 (i,0,(int)(n)-1)
#define REP(...) GET_ARG (__VA_ARGS__,REP3,REP2) (__VA_ARGS__)
#define RREP3(i,s,e) for (i = s; i >= e; i--)
#define RREP2(i,n) RREP3 (i,(int)(n)-1,0)
#define RREP(...) GET_ARG (__VA_ARGS__,RREP3,RREP2) (__VA_ARGS__)
#define DEBUG(x) cerr << #x ": " << x << endl

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

C++: #include <iostream>
using namespace std;
int main () {
	double m[4], e, f, d;
	cout.setf (ios::fixed); cout.precision (3);
	while (cin >> m[0] >> m[1] >> e >> m[2] >> m[3] >> f) {
		d = m[0]*m[3] - m[1]*m[2];
		cout << ((m[3]*e-m[1]*f)/d) << " " << ((m[0]*f-m[2]*e)/d) << endl;
	}
}

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

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

C++: #include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>

using namespace std;

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

C++: #include <stdio.h>

int main (void){
	int a, b, c, d, e, f;
	double ans[2];
	while(scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f)!=EOF){
		ans[0]=(double)(b*f-c*e)/(d*b-a*e);
		ans[0]*=10000;
		if((int)ans[0]%10>4){
			ans[0]-=(int)ans[0]%10;
			ans[0]+=10;
		}else{
			ans[0]-=(int)ans[0]%10;
		}
		ans[0]/=(double)10000;
		
		ans[1]=(double)(c*d-a*f)/(b*d-a*e);
		ans[1]*=10000;
		if((int)ans[1]%10>4){
			ans[1]-=(int)ans[1]%10;
			ans[1]+=10;
		}else{
			ans[1]-=(int)ans[1]%10;
		}
		ans[1]/=(double)10000;
		
		printf("%.3lf %.3lf\n", ans[0], ans[1]);
	}
	return 0;
}

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

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

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

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