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

		fmt.Printf("%d.000 ", x)
		fmt.Printf("%d.000\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(cin>>a>>b>>c>>d>>e>>f){
        bb=b/a;
        cc=c/a;
        ee=e/d;
        ff=f/d;
        y=(cc-ff)/(bb-ee);
        x=(c-b*y)/a;
        //y=123.45678;
        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>
using namespace std;

int main(){

	float a, b, c, d, e, f;

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

		float det = a * e - b * d;

		float dx = c * e - b * f;
		float dy = a * f - c * d;

		float x = dx / det;
		float y = dy / det;

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

	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <fstream>
#include <stdint.h>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
using namespace std;

constexpr int INF       = 1000000000;/* 1e+9a */
constexpr int MODULO    = 1000000007;

#define REP(i,f,n) for(int i=(f); i < (n); ++i)
#define PER(i,f,n) for(int i=(n-1); i >= f; --i)

signed main()
{
    ios::sync_with_stdio(false);
	int a, b, c, d, e, f;
	while(cin >> a)
	{
		cin >> b >> c >> d >> e >> f;
		double m = a * e - b * d;
		double x = (c * e) /m -( b * f)/m;
		double y = (a * f) /m -( c * d)/m;

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

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

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

int main() {
  int a, b, c, d, e, f;
  std::cout.precision(3);
  std::cout << std::fixed;
  while (!std::cin.eof()) {
    std::cin >> a >> b >> e >> c >> d >> f;

    double factor = a * d - b * c;
    double x = ( d * e + -b * f) / factor;
    double y = (-c * e +  a * f) / factor;
    std::cout << x << ' ' << y << std::endl;

    while (isspace(std::cin.peek())) { std::cin.ignore(); }
  }
}

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

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

C++: #include <iostream>
#include <cmath>
#include <vector>

int main()
{
    using namespace std;
    typedef struct {
        double x;
        double y;
    } xy;
    double a, b, c, d, e, f, x, y;
    vector<xy> results;
    
    cout.precision(3);
    cout << fixed << showpoint;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double coef = d/a;
        b *= coef; c *= coef;
        y = (c - f)/(b - e);
        x = (f - e*y)/d;
        x = round(x*1000.0)/1000.0;
        y = round(y*1000.0)/1000.0;
        if (x == 0) x = fabs(x);
        if (y == 0) y = fabs(y);
        results.push_back( {x,y} );
        // cout << x << " " << y << endl;
    }
    for (vector<xy>::iterator itr = results.begin();
         itr != results.end(); ++itr) {
        // xy& tmp = *itr;
        cout << itr->x << " " << itr->y << endl;
    }
}

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

using namespace std;

int main() {
	int i=0;
	int a[10000], b[10000], c[10000], d[10000], e[10000], f[10000];
	while (1) {
		cin >> a[i] >> b[i] >> c[i] >> d[i] >> e[i] >> f[i];
		if (a[i] == 0 && b[i] == 0 && c[i] == 0 && d[i] == 0 && e[i] == 0 && f[i] == 0)break;
		i++;
	}
	int x[10000], y[10000];
	for (int j = 0; j < i; j++) {
		y[j] = (double)(c[j] * d[j] - a[j] * f[j]) / (double)(b[j] * d[j] - a[j] * e[j]);
		x[j] = (double)(c[j] * e[j] - b[j] * f[j]) / (double)(a[j] * e[j] - b[j] * d[j]);
		printf("%d.3f %d.3f\n", x[j], y[j]);
	}
	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;
    }
    return 0;
}

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

double* solve_equations(double *a)
{
	// クラメルの公式を用いる
	int data_size=sizeof(a[0]);
	/*cout << "data_size=" << data_size << endl;
	cout << "a=" << a << endl;
	cout << "*(a + data_size*1)=" << *(a + 1) << endl;
	cout << "*(a + data_size*0) * *(a + data_size*4)" << *(a + data_size*0) * *(a + data_size*4) << endl; */
	double z = *(a + 0) * *(a + 4) 
		   - *(a + 1) * *(a + 3);
	double x = *(a + 2) * *(a + 4)
		   -	*(a + 1) * *(a + 5);
	double y = *(a + 0) * *(a + 5)
		   - *(a + 2) * *(a + 3); 
	double ax,ay;
	/*cout << "x=" << x << endl;
	cout << "y=" << y << endl;*/
	ax = pow(z,-1)*x;
	ay = pow(z,-1)*y;
	
	/* cout << ax << endl;
	cout << ay << endl; */
	double ans[2] = {ax,ay};
	return ans;
}

int main()
{
	double n[6];
	double s;
	int i=0;
	while (cin >> s){
		if (i == 5){
			n[i]=s;
			/* for (int j=0;j<=5;j++)
			{
				cout << "n[" << j << "]=" << n[j] << endl;
			}*/
			double* an;
			an = solve_equations(n);
			/* printf("%.3lf",*(an+0));
			cout << " " << endl;
			printf("%.3lf",*(an+1)); */
			if (an[1] == 0)
				cout << fixed << setprecision(3) << an[0] << " " << 0.000 << endl;
			else if(an[0] == 0)
				cout << fixed << setprecision(3) << 0.000 << " " << an[1] << endl;
			else
				cout << fixed << setprecision(3) << an[0] << " " << an[1] << endl;

			i = 0;}
		else{
			n[i]=s;
			i++;
		}
	}
	return 0;
			// cout << l[0]  endl;
}

C++: #include<stdio.h>

int main(){

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

while(scanf("%lf %lf %lf %lf %lf %lf",&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)x=0;if(y==-0)y=0;
printf("%.3lf %.3lf\n",x,y);
}
return 0;
}

C++: #include<stdio.h>
main(){
  double a,b,c,d,e,f;
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)==""){
    printf("%f %f\n",(c*e-b*f)/(a*e-b*d),(a*f-c*d)/(a*e-b*d));
  }
}

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

int main(void)
{
	double a,b,c,d,e,f;
	double ans[2];

	cin >> a >> b >> c >> d >> e >> f;

	ans[1] = (c*d-a*f)/(b*d-a*e);
	ans[0] = (c*d-b*d*ans[1])/(a*d);

	printf("%.3lf %.3lf\n", ans[0]+0.0005,ans[1]+0.0005);

	return 0;
}