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

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


    double A = a*e-b*d;
    double ans1, ans2;
    ans1 = (c*e - b*f)/A;
    ans2 = (-c*d + a*f)/A;
    if(ans1<0.0005 && ans1> -0.0005) ans1 = 0;
    if(ans2<0.0005 && ans2> -0.0005) ans2 = 0;

    printf("%1.3f %1.3f\n",ans1,ans2);
    }
    return 0;
}

C++: #include <algorithm>
#include <cstdio>
#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;
        printf("%.3f %.3f\n",x,y);
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#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){
    x=(a*f-c*d)/(a*e-b*d);
    y=(c*e-f*b)/(a*e-b*d);
    printf("%.3lf %.3lf \n",y,x);
  }
}

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

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

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

	return 0;
}

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

int main() {
	int a, b, c, d, e, f;
	int cnt = 0;
	std::vector<double> x_vector;
	std::vector<double> y_vector;

	while (cin >> a >> b >> c >> d >> e >> f) {
	//???????????°
	/*
	while (!cnt) {
		cnt++;
		cin >> a >> b >> c >> d >> e >> f;
	*/
	//end ??????????????°
		double x = (b * f - c * e) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);

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

	for (unsigned int i = 0; i < x_vector.size(); 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<cstdio>
using namespace std;
int main()
{
  double 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;
    if(x == -0) x = 0;
    if(y == -0) y = 0;
    printf("%.3lf %.3lf\n", x, y);
  }

  return 0;
}

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

int main(){
double a,b,c,d,e,f,a_,b_,c_,d_,e_,f_;
double x,y;
double in;
while (std::cin >>a>>b>>c>>d>>e>>f){
in = (a*e - b*d);
a_ = a/in;
b_ = -1*d/in;
d = -1*b/in;
e_ = e/in;
x = c * a_ + f*b_;
y = c*d_ + f*e_;
std::cout << std::setprecision(3) << std::fixed << x << ' ' << std::setprecision(3) <<std::<<fixed <<  y << std::endl;
}
    return 0;
}

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

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

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

int main(){
  double a, b, c, d, e, f, x, y; //連立方程式の各係数

  while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
    x = (b * f - c * e) / (b * d - a * e);
    y = (c * d - a * f) / (b * d - a * e);

    if(x == -0){
      x = 0.0;
    }
    if(y == -0){
      y = 0.0;
    }

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

  return 0;
}

C++: #include<iostream>
int GCM(int a,int b){
	if(b==0)return a;
	return GCM(b,a%b);
}

int main(){
	int a,b,c,d,e,f;
	std::cin>>a>>b>>c>>d>>e>>f;
	float x,y;
	int a_=a,b_=b,c_=c,d_=d,e_=e,f_=f;
	b_*=GCM(a,d)/a,c_*=GCM(a,d)/a;
	e_*=GCM(a,d)/d,f_*=GCM(a,d)/d;
	y=(c_-f_)/(b_-e_);
	x=(c-y*b)/a;
	std::cout<<x<<" "<<y<<std::endl;
	return 0;
}

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

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

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

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

C++: #include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
int main() {
 int cn=0;
 double a,b,c,d,e,f,i;
 vector<double> x,y;
 while(cin >> a >> b >> c >> d >> e >> f) {
	 y.push_back((c-f*a/d)/(b-e*a/d));
	 x.push_back((c-b*y[cn++])/a);
	 }
 for (i=0;i<cn;i++) printf("%.3f %.3f\n",x[i],y[i]); 
 return 0;
}

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

using namespace std;
 
#define N 2

int main(void)
{
	double a[N][N+1];
	int i, j, k;
	for( i=0; i<N; i++ ){
		for( j=0; j<N+1; j++ ){
			cin >> a[i][j];
		}
	}

	double p, d;
	for( k=0; k<N; k++ ){
		p = a[k][k];
		for( i=0; i<N+1; i++ )
			a[k][i] /= p;
		for( i=0; i<N; i++ ){
			if( i != k ){
				d = a[i][k];
				for( j=0; j<N+1; j++ ){
					a[i][j] -= a[k][j]*d;
				}
			}
		}
	}

	cout << setprecision(3) << setiosflags(ios::fixed);
	cout << a[0][N] << " " << a[1][N] << endl;

	return 0;
}

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

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

C++: #include<iostream>
#include<cstdio>
#include<iomanip>
#include<vector>
using namespace std;
class SimultaneousEquation{ 
    public:
        void solve(vector<int> abcdef){ 
            double x,y;
            for(x=-1000;x<=1000;x++){ 
                for(y=-1000;y<=1000;y++){ 
                    if(abcdef[0]*x+abcdef[1]*y==abcdef[2]&&abcdef[3]*x+abcdef[4]*y==abcdef[5])printf("%.3lf %.3lf\n",x,y);
                }
            }
        }
};
int main(){ 
    vector<int> abcdef(6);
    while(cin>>abcdef[0]>>abcdef[1]>>abcdef[2]>>abcdef[3]>>abcdef[4]>>abcdef[5]){
        SimultaneousEquation inst;
        inst.solve(abcdef);
    }
}