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 <vector>
#include<iomanip>
using namespace std;

struct xy
{
	double x;
	double y;
};
int main()
{
	double a, b, c, d, e, f,x,y;
	vector<xy> dst;
	while (cin>> a >> b >> c >> d >> e >> f) {
		y = (f - d / a * c) / (e - d / a * b);
		x = (c - b * y) / a;
		dst.push_back({ x,y });
	}
	for (vector<xy>::iterator it = dst.begin(); it < dst.end(); it++) {
		cout.setf(ios::fixed);
		cout << fixed << setprecision(3) << (*it).x<<" "<<(*it).y << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(void){
    // Here your code !
    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;
        //cout << %.3f %.3f\n << x / 1000 << y / 1000 << endl;
        cout << fixed << setprecision(3) << x /1000 << " " << y / 1000 <<endl;
    }
    return 0;
}

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

using namespace std;


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

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

int main() {
	double a, b, c, d, e, f, x, y;
	while(cin >> a >> b >> c >> d >> e >> f) {
		y = (c*d-f*a)/(b*d-e*a);
		x = (c-b*y)/a;

		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(void){
     
    double x, y;
    int a, b, p;
    int c, d, q;
 
    while (cin >> a >> b >> p >> c >> d >> q){
 
        x = (double)((p * d - b * q) / (a * d - b * c));
        y = (double)((a * q + p * c) / (a * d - b * c));
        if (x == 0)x = 0;
        if (y == 0)y = 0;
        printf("%.3f %.3f\n", x, y);
    }
}

C++: #include <iostream>
#include <cstdio>
int main(){
double a,b,c,d,e,f,x,y;
while(std::cin>>a>>b>>c>>d>>e>>f){
	x = (double)(b*f-c*e)/(b*d-a*e);
	y = (double)(f*a-d*c)/(a*e-b*d);
	printf("%.3f %.3f\n",x==-0.000?0.000:x, y==-0.000?0.000:y);
}
}

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

int main( )
{
    int a, b, c, d, e, f;
    double x, y;
 
    while( cin >> a >>  b >> c >> d >> e >> f )
    {
        x = (double) ( e * c - b * f ) / ( a * e - b * d );
        y = (double) ( a * f - c * d ) / ( a * e - b * d );
	
	x += 0;
	y += 0;

        cout << fixed << setprecision(3) << x << " " << y << endl; 
    }
    return 0;
}

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

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++: #include<iostream>
using namespace std;

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

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

int main()
{ 
	double x1, x2, y1, y2, z1, z2;
	double x, y;
	while (cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2) {//係数値を入力している。
		double tmp = x1;
		x1 *= x2; y1 *= x2; z1 *= x2;//xの係数で連立する。
		x2 *= tmp; y2 *= tmp; z2 *= tmp;
		y = (z1 - z2) / (y1 - y2);//ｙを計算する。
		if (z1 - z2 == 0)y = 0;//-0.000にならないようにしている。
		x = (z1 - (y1*y)) / x1;//xの計算
		if (z1 - (y1*y) == 0)x = 0;//-0.000にならないようにしている。
		int a, b;
		a = x * 10000;//小数第4桁の四捨五入
		if (a % 10 > 4) {
			a += 10;
			x = double(a) / 10000;
		}
		b = y * 10000;//小数第4桁の四捨五入
		if (b % 10 > 4) {
			b += 10;
			y = double(b) / 10000;
		}
		cout << fixed;//小数第4桁までを出力したい
		cout << setprecision(3) << x << ' ' << y << endl;

	}
	return 0;
}

C++: /**********************************************************
Status:
Problem:
Author:     Md. Shahidul Islam,
            Department of Computer Sciemce and Engineering,
            Begum Rokeya University, Rangpur, Bangladesh
Created on:
***********************************************************/

#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1)
#define vi vector<int>
#define ll long long
#define eps 1e-6
int main()
{
    //freopen("d.txt", "r", stdin);
    int a,  b, c, d, e, f;
    double x, y;
    while(scanf("%d %d %d", &a, &b, &c)!=EOF)
    {
        scanf("%d %d %d", &d, &e, &f);
        
        y=(double)((c*d-a*f)/(b*d-a*e));
        x=(double)((c-b*y)/a);
        printf("%.3lf %.3lf\n", x, y);
    }
    return 0;
}
/**********************************************************
About this problem:

************************************************************/

C++: #include<bits/stdc++.h>
using namespace std;
 main(){
  int a,b,c,d,e,f,r,lcm;
  int n,m;
  int x,y,num,sum;

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

    if(a>d){
      m=a;
      n=d;
      if(a<0){
	m*=-1;
      }
      if(d<0){
	n*=-1;
      }
    }
    else{
      m=d;
      n=a;
      if(a<0){
	n*=-1;
      }
      if(d<0){
	m*=-1;
      }
    }

    r=m%n;
    while( r != 0 ){
      m=n;
      n=r;
      r=m%n;
    }
    lcm=a*d/n;

    num=lcm/a;
    sum=lcm/d;

    a*=num;
    b*=num;
    c*=num;

    d*=sum;
    e*=sum;
    f*=sum;

    if( a-d == 0 ){
      y=(c-f)/(b-e);
    }
    else if( a+b == 0 ){
      y=(c+f)/(b+e);
    }

    x=(c-b*y)/a;

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

  }
  return(0);
}

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

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

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

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

		x *= 10000;
		x = x + 0.5 - (x < 0);
		x = (int)x;
		x /= 10000;

		y *= 10000;
		y = y + 0.5 - (y < 0);
		y = (int)y;
		y /= 10000;


		cout << setprecision(4) << showpoint << x << " " << y << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
	float a,b,c,d,e,f;
	float g,h,i,j,k,l,n,m,o,p,q,r;
	while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF){
		g=a/d;
		a*=g*-1;
		b*=g*-1;
		c*=g*-1;
		h=b+e;
		i=c+f;
		j=i/h;
		k=e*j;
		l=f-k;
		n=l/d;
		cout<<n<<" "<<j<<endl;
	}
	return 0;
}