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
		if bE==0{
		    bE=1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		
			fmt.Printf("%d.000 ", x)
			fmt.Printf("%d.000\n", y)
	}
}

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){

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

	return 0;

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;
	
	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<stdio.h>
int main(){
	int a,b,c,d,e,f;
	double x,y,z,v;
	while(1){
	scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
	x=(double)(c*e-b*f)/(a*e-b*d);
	y=(double)(c*d-a*f)/(b*d-a*e);
	if(x>=-0.0005&&x<0.0005)	x=0;
	if(y>=-0.0005&&y<0.0005)	y=0;
	printf("%.3lf %.3lf\n",x,y);
}
}

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

int main(???
{
	int 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", x, y);
	}
	
	return 0;
}

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

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

#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

void solver() {
    double a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        auto x = (c * e - f * b) / (a * e - b * d);
        auto y = (c - a * x) / b;
        if(x<0.0005) x=0;
        if(y<0.0005) y=0;
        printf("%.3f %.3f\n",x,y);
    }
}

int main() {
    solver();
    return 0;
}

C++: #include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<string>
int gcd(int a, int b) {
	int num;//?????§??¬?´???°
	for (int i = std::min(a, b); i >= 0; --i) {
		if (a%i == 0 && b%i == 0) { num = i; break; }
	}
	return a*b / num;
}
int main() {
	double a, b, c,d,e,f;
	double x, y;
	while (std::cin >> a >> b >> c >> d >> e >> f) {
		y = (c*gcd(a, d) / a - f*gcd(a, d) / d) / (gcd(a, d) / a*b - gcd(a, d) / d*e);
		y *= 1000; y = std::round(y); y /= 1000;
		x = (c - b*y) / a;
		x *= 1000; x = std::round(x); x /= 1000;
		std::cout << x << " " << y << std::endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <memory.h>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <ctime>
#include <iostream>
#include <functional>
#include <complex>
#include <iomanip>
#pragma comment(linker, "/STACK:836777216")

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef pair<pii, int> p3i;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<p3i> v3i;
typedef vector<vii> vvii;
typedef vector<p3i> vp3i;
typedef long double ld;
typedef vector<ld> vld;

#define pb push_back
#define mp make_pair
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define REPD(i, n) for (int (i) = (n) - 1; (i) >= 0; (i)--)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define FORD(i,a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define sz(v) (int)(v).size()
#define all(v) (v).begin(), (v).end()
#define rv(v) reverse(all(v))
#define CL(v, val) memset((v), (val), sizeof((v)))
#define SORT(a) sort(all(a))
#define un(v) SORT(v), (v).resize(unique(all(v)) - (v).begin())
#define eps 1.0e-7
#define X first
#define Y second
#define bit(n) (1 << (n))
#define bit64(n) (ll(1) << (n))
#define sqr(n) ((n) * (n))

ll DET(ll a, ll b, ll c, ll d) {
  return a * d - b * c;
}

int main(void) {
  ll a,b,c,d,e,f;
  while (scanf("%lld%lld%lld%lld%lld%lld", &a, &b, &c, &d, &e, &f) == 6) {
    ll det = DET(a,b,d,e);
    ll det1 = DET(c,b,f,e);
    ll det2 = DET(a,c,d,f);
    double x = 1.0 * det1 / det;
    double y = 1.0 * det2 / det;
    printf("%.3lf %.3lf\n", x + eps, y + eps);
  }
  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){
    B =(c*e-f*b)/(a*e-b*d);
    A = (c -b*B)/a;
    
    A =floor((A+0.0005)*1000)/1000;//小数第4位を四捨五入
    B =floor((B+0.0005)*1000)/1000;
    printf("%.3f %.3f\n",B,A);
  }
  return 0;
}

C++: #include <stdio.h>

int main() {
	float a, b, c, d, e, f;
	float x, y;

	while (scanf("%f", &a) != EOF) {
		scanf("%f %f %f %f %f", &b, &c, &d, &e, &f);
		b *= d / a;
		c *= d / a;
		a = d;
		if ((a > 0 && d > 0) || (a < 0 && d < 0)) {
			a *= -1;
			b *= -1;
			c *= -1;
		}
		e += b;
		f += c;
		y = f / e;
		x = (-1 * b * y + c) / a;
		if (x == -0) x = 0;
		else if (y == -0) y = 0;

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

	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<string>
using namespace std;
/*
??£???????¨????
	ax + by = c
	dx + ey = f
????§£x, y???????????????????????°??????
*/
int main() {
	int a, b, c, d, e, f;
	int cnt = 0;						//??\??????????????£???????¨????????????°
	std::vector<double> x_vector;		//x????§£???????´?
	std::vector<double> y_vector;		//y????§£???????´?

#if 0
	while (cnt < 2) {
		cin >> a >> b >> c >> d >> e >> f;
#else
	while (cin >> a >> b >> c >> d >> e >> f) {
#endif
		double x = (b * f - c * e) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);

		cnt++;
		x_vector.push_back(x);
		y_vector.push_back(y);
	}

	for (unsigned int i = 0; i < cnt; i++) {
		std::cout << std::fixed;
		std::cout << std::setprecision(3) << x_vector[i] << " ";
		std::cout << std::setprecision(3) << y_vector[i] << endl;
	}

	//???????????°
	//while (1);

	return 0;
}

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

int main(){
    double a,b,c,d,e,f;

    while(cin>>a){
    if (a==EOF)
        break;
    cin>>b>>c>>d>>e>>f;
    double temp=b/e;
    double x,y;
    x=(c-temp*f)/(a-temp*d);
    temp=a/d;
    y=(c-temp*f)/(b-temp*e);


    cout.setf(ios::fixed);
    cout.precision(3);
    cout<<x<<" "<<y<<endl;
    }
    return 0;
}