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<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++) {
		int dummy_x = x_vector[i];		//?????£????????????????°???°?????\?????????
		int dummy_y = y_vector[i];		//?????£????????????????°???°?????\?????????

		//x?????????????°???°????¬¬4???????????¨?????\
		if (5 <= (x_vector[i] * 10000 - dummy_x * 10000)) {
			x_vector[i] += 0.001;
		}

		//y?????????????°???°????¬¬4???????????¨?????\
		if (5 <= (y_vector[i] * 10000 - dummy_y * 10000)) {
			y_vector[i] += 0.001;
		}

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

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

C++: #include <iostream>

using namespace std;

int main()
{
	double	x,a,b,c,d,e,f;
	cin >> a >> b >> c >> d >> e >> f;
	//a*x-b*d*x/e =c-b*f/e
	for(x=-1000000;x<1000000;x++)
	{
		if(a*(x/1000)+b*((f-d*(x/1000))/e) == c)
		{
			printf("%0.3lf",x/1000);
			break;
		}
	}
	cout << endl;
	
	printf("%0.3lf",(f-d*x/1000)/e); //yÌoÍ
}

C++: #include <iostream>
#include <stdlib.h>
#include <string.h>
#include <sstream>
#include <iostream>
#include <math.h>
#include <iomanip>

using namespace std;

string float_to_string(float f, int digits)
{
  if (f == 0) {
    f = 0;
  }
  ostringstream oss;
  oss << setprecision(digits) << setiosflags(ios::fixed) << f;
  return oss.str();
}

void calc_and_output(int *c)
{
  float x = (float)(c[1]*c[5]-c[2]*c[4])/(c[1]*c[3]-c[0]*c[4]);
  float y = (float)(c[0]*c[5]-c[2]*c[3])/(c[0]*c[4]-c[1]*c[3]);

  cout << float_to_string(x, 3) << " " << float_to_string(y, 3) << endl;
}

int main(int argc, char const* argv[])
{
  int c[6];

  string line;
  while (getline(cin, line)) {
    istringstream iss(line);
    int val;
    int c[6];
    for (int i = 0; i < 6; i++) {
      iss >> val;
      c[i] = val;
    };

    calc_and_output(c);
  }

  return 0;
}

C++: #include <iostream>
#include <iomanip>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;

int main() {
    int a[3];
    int b[3];
    int y[3];
    int x[3];
    while(true) {
    REP(i,3)
        cin >> a[i];
    REP(i,3)
        cin >> b[i];
    if(!cin)
        return 0;
    REP(i,3) 
        y[i] = b[i]*a[0] - a[i]*b[0];
    REP(i,3)
        x[i] = b[i]*y[1] - y[i]*b[1];
    double o[2];
    o[0] = x[2]/double(x[0]);
    o[1] = y[2]/double(y[1]);
    REP(i,2)
        o[i] = (o[i]==0)?0:o[i];
    cout << fixed << setprecision(3) << o[0] << ' ';
    cout << fixed << setprecision(3) << o[1] << '\n';
    }
}

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

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

C++: #include <cstdio>

int main(){
	int p1[5],p2[5],a[5];
	float h[5];

	while(scanf("%d %d %d %d %d %d",&p1[1],&p1[2],&p1[3],&p2[1],&p2[2],&p2[3])!=EOF){
		p1[2] = p1[2]*p2[1];
		p1[3] = p1[3]*p2[1];

		p2[2] = p2[2]*p1[1];
		p2[3] = p2[3]*p1[1];

		p1[1] = p1[1]*p2[1];

		a[1] = p1[2]-p2[2];
		a[2] = p1[3]-p2[3];

		h[2] = a[2]/a[1];

		if(p1[2]*h[2] <= 0)
		{
			h[1] = (p1[3]+(p1[2]*h[2]))/p1[1];
		}else if(p1[2]*h[2] >= 0)
		{
			h[1] = (p1[3]-(p1[2]*h[2]))/p1[1];
		}

		printf("%.3f %.3f\n", h[1],h[2]);
	}
}

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

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++: //
//  main.cpp
//  b
//
//  Created by h3037178 on 2017/07/31.
//  Copyright ?? 2017??´ ?????£?????????. All rights reserved.
//

#include <iostream>
#include<algorithm>
#include<math.h>
#include<stdio.h>
using namespace std;
int main(){
    float a,b,c,d,e,f,x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        x=(c*e-f*b)/(a*e-b*d);
        y=(c*d-f*a)/(b*d-a*e);
        printf("%.3f %.3f\n",x,y);
    }
}

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

int main(){
	
	double a, b, c, d, e, f;
	// input
	while(std::cin >> a >> b >> c >> d >> e >> f){
		
		/*	solve the equation
		*	y = (f - d*x) / e
		*	x = (c*e - b*f) / (a*e - b*d)
		*/
		double x = (c*e - b*f) / (a*e - b*d);
		double y = (f - d*x) / e;
		// output
		std::cout << std::fixed << std::setprecision(3) <<  x << " " << y << std::endl;
	}
	
	return 0;
}

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

#define N 2

using namespace std;

int main(){
	double a[N][N+1];
	double d;
	int i, j, k;
	bool flag = 1;

	while(cin >> a[0][0] >> a[0][1] >> a[0][2] >> a[1][0] >> a[1][1] >> a[1][2]){
		for(k = 0; k < N - 1; k++){
			for(i = k+1; i < N; i++){
				d = a[i][k] / a[k][k];
				for(j = k + 1; j <= N; j++){
					a[i][j] = a[i][j] - a[k][j] * d;
				}
			}
		}
		for(i = N - 1; i >= 0; i--){
			d = a[i][N];
			for(j = i + 1; j < N; j++){
				d = d - a[i][j] * a[j][N];
			}
			a[i][N] = d / a[i][i];
		}
		printf("%.3lf %.3lf", a[0][N], a[1][N]);
	}
	return 0;
}

C++: #include<stdio.h>

int main(void)
{
	int a,b,c,d,e,f;
	while(scanf("%d%d%d%d%d%d\n",&a,&b,&c,&d,&e,&f) != EOF){
	
	double y = ((c*d-a*f)/(b*d-a*e));
	double x = ((c-b*y)/a);
	
	printf("%0.3f %0.3f\n", (double)x,(double)y);
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>




void main(void) {
	printf("a,b,c,d,e,f??????????????????????????§??\?????????????????????\n");
	double a=0, b=0, c=0, d=0, e=0, f=0;
	scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
	double x = (f*b - e*c) / (d*b - e*a);
	double y = (f*a - d*c) / (e*a - d*b);
	printf("%f %f\n", x, y);
	return;
}