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

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

C++: #include<iostream>
#include<iomanip>
using namespace std;
int main(){
	int a,b,c,d,e,f,two,three;
	while (cin >> a >> b >> c >> d >> e >> f){
		two = b*d-e*a;
		three = c*d - f*a;
		std::cout << std::setprecision(4) << c - b*three / two << " " << three / two << endl;
	}
	return 0;
}

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



#ifndef DEBUG 
#define fprintf (void)
#endif 

int main(void){
	
	double a,b,c,d,e,f;
	double x,y,div;
	int xd[5],yd[5];
	int i;
	double megax,megay;
	int recx,recy;
	

	while(scanf("%lf",&a)!=EOF){
		scanf("%lf",&b);
		scanf("%lf",&c);
		scanf("%lf",&d);
		scanf("%lf",&e);
		scanf("%lf",&f);
		
		div=b*d-a*e;
		x=(b*f-c*e)/div;
		y=(c*d-a*f)/div;
		
		megax=x*10000;
		megay=y*10000;
		
		if(x==-0){
			fprintf(stdout,"yabaix\n");
			x=fabs(x);
		}
		
		if(y==-0){
			fprintf(stdout,"yabaiy\n");
			y=fabs(y);
		}
		
		recx=(int) fabs(megax);
		
		for(i=4;i>0;i--){
		xd[i]=recx%10;
		recx/=10;
		}
		
		xd[0]=recx;
	
		if(xd[4]>=5){
			xd[3]++;
		}
		
		if(xd[3]>=10){
			xd[2]++;
			xd[3]=0;
		}
		
		if(xd[2]>=10){
			xd[1]++;
			xd[2]=0;
		}
		
		if(xd[1]>=10){
			xd[0]++;
			xd[1]=0;
		}
		
		recy=(int) fabs(megay);
		
		for(i=4;i>0;i--){
		yd[i]=recy%10;
		recy/=10;
		}
		
		yd[0]=recy;
	
		if(yd[4]>=5){
			yd[3]++;
		}
		
		if(yd[3]>=10){
			yd[2]++;
			yd[3]=0;
		}
		
		if(xd[2]>=10){
			yd[1]++;
			yd[2]=0;
		}
		
		if(yd[1]>=10){
			yd[0]++;
			yd[1]=0;
		}

		if(x<0){
			xd[0]*=-1;
		}
		
		if(y<0){
			yd[0]*=-1;
		}

		
		printf("%d.%d%d%d %d.%d%d%d\n",xd[0],xd[1],xd[2],xd[3],yd[0],yd[1],yd[2],yd[3]);
	}
	
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

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

int main() {
	a = -10000;
	cin >> a >> b >> c >> d >> e >> f;

	while (a != -10000) {
		x = (c * e - f * b) / (a * e - d * b);
		y = (c * d - f * a) / (b * d - e * a);

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

		a = -10000;
		cin >> a >> b >> c >> d >> e >> f;
	}

	return 0;
}

/*@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@                       @*/
/*@ debug output erased ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/

C++: #include <iostream>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  while (cin >> a >> b >> c >> d >> e >> f) {
    printf("%.3f %.3f\n",  (1.0 * b * f - c * e) / (b * d - a * e), (1.0 * a * f - c * d) / (a * e - b * d));
  }
  return 0;
}

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

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

void pri(double a, double b, double c, double d, double e, double f){
	printf("(%4f)x + (%4f)y = (%4f)\n(%4f)x + (%4f)y = (%4f)\n\n", a, b, c, d, e, f);
}

int main(){
	double a, b, c, d, e, f, x, y;
	
	while(cin >>a >>b >>c >>d >>e >>f){
		
		b /= a; c /= a; a /= a;
		
		e -= d * b; f -= d * c;
		
		y = f / e;
		
		x = c - (b * y);
		
		if(x < 0) x = ceil(x * 1000 - 0.5) / 1000;
		else x = floor(x * 1000 + 0.5) / 1000;
		if(y < 0) y = ceil(y * 1000 - 0.5) / 1000;
		else y = floor(y * 1000 + 0.5) / 1000;
		
		printf("%.3f %.3f\n", x, y);
	}
	
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>

#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

int main(void){
    
    int i,j=0,k = 0,l=0,m = 0,n= 0;
    double a,b,c,d,e,f;
    double x1,x2;
    
    cin >> a >> b >> c;
    cin >> d >> e >> f;
    
    double gyouretusiki = (a*e - d*b);
    
    x1 = (c/a) - (b/gyouretusiki)*(f -((d*c)/a));
    
    x2 = ((a) /(gyouretusiki))*(f-((d*c)/a));
    
    
    printf("%.3f %.3f\n",x1,x2);
    return 0;
            
                  
                  
    
}

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

double r(double d){
  double a = roundl(d*1000);
  if(a==0) return +0.0;
  return a/1000;
}

int main(){
  double a,b,c,d,e,f;
  while(~scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f))
    printf("%.3f %.3f",r((c*e-b*f)/(a*e-b*d)),r((-c*d+a*f)/(a*e-b*d)));
}

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

int get_gcd(int a, int b) {
    if (a % b == 0) return b;
    return get_gcd(b, a % b);
}

int main() {
    int a,b;
    while (cin>>a>>b) {
        if (a < b) {
            int tmp = a;
            a = b;
            b = tmp;
        }

        int gcd = get_gcd(a,b);

        int lcm = (a * b) / gcd;
        cout << gcd << " " << lcm << endl;

    }
    return 0;
}

C++: #include <stdio.h>
#define EPS 1e-10
int main() {
    int a,b,c,d,e,f,x;double q,r;while (scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF) {
        x=-a;a*=d,b*=d,c*=d;d*=x,e*=x,f*=x;q=(f+c)/(b+e+0.0);r=(f-(e*q))/(d+0.0);if (r<EPS && r>-EPS) r=0.0;if (q<EPS && q>-EPS) q=0.0;printf("%.3lf %.3lf\n",r,q);} return 0;}

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

int main(void) {
  string input;
  while (getline(cin, input)) {
    float a, b, c, d, e, f;
    sscanf(input.c_str(), "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f);
    float x = (c*e-b*f)/(a*e-b*d);
    float y = (c*d-a*f)/(b*d-a*e);
    printf("%.3f %.3f\n", x, y);
  }
}

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

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

int main() {
	int a, b, c, d, e, f;
	vector<double> x, y;
	while (cin >> a) {
		double tmpY;
		cin >> b >> c >> d >> e >> f;
		if (a*e != b*d) {
			y.push_back((c*d - a*f) / (b*d - a*e));
			tmpY = (c*d - a*f) / (b*d - a*e);
		} else {
			continue;
		}
		if (a != 0) {
			x.push_back((c - b*tmpY) / a);
		} else if (d != 0) {
			x.push_back((f - e*tmpY) / d);
		} else {
			continue;
		}
	}

	for (int i = 0; i < x.size(); i++) {
		cout << fixed << setprecision(3) << x[i] << " " << y[i] << endl;
	}
}