Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

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]
		var mulA, mulD int
		if a < 0 {
			mulA = a * -1
		} else {
			mulA = a
		}
		if d < 0 {
			mulD = d * -1
		} else {
			mulD = d
		}
		a *= mulD
		b *= mulD
		c *= mulD
		d *= mulA
		e *= mulA
		f *= mulA

		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.Print(x)
		fmt.Print(".000 ")
		fmt.Print(y)
		fmt.Println(".000")
	}
}

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

typedef struct {
    double x;
    double y;
} xy;

int main()
{
    using namespace std;
    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 denom = (b*d - a*e);
        x = (b*f - c*e)/denom;
        y = (c*d - a*f)/denom;
        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} );
    }
    for (vector<xy>::iterator itr = results.begin();
         itr != results.end(); ++itr) {
        cout << itr->x << " " << itr->y << endl;
    }
}

C++: #include <stdio.h>

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

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    const int TMP = 1000;
    for(;;){
        int a,b,c,d,e,f;
        if(!(cin >> a >> b >> c >> d >> e >> f))
            return 0;
        int x = 10 * TMP * (c*e - b*f) / (a*e - b*d);
        int y = 10 * TMP * (c*d - a*f) / (b*d - a*e);
        int xSign = (x>=0? 1:-1);
        int ySign = (y>=0? 1:-1);
        x = abs(x);
        y = abs(y);

        if(x % 10 >= 5)
            x += 10;
        x /= 10;
        if(xSign == -1 && x > 0)
            cout << '-';
        printf("%d.%03d ", x/TMP, x%TMP);

        if(y % 10 >= 5)
            y += 10;
        y /= 10;
        if(ySign == -1 && y > 0)
            cout << '-';
        printf("%d.%03d\n", y/TMP, y%TMP);
    }
}

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

using namespace std;

int main(){

	//FILE *fp;
	//if((fp=fopen("output.txt","w"))==NULL){
	//	return -1;
	//}

	int a,b,c,d,e,f;
	while(1){
		cin >> a >> b >> c >> d >> e >> f;
		if(cin.eof()){
			break;
		}
		double y = (double)(a*f-c*d)/(a*e-b*d);
		double x = (double)(c-b*y)/a;
		fprintf(stdout,"%.3f %.3f\n",x,y);
	}
//	fclose(fp);

	return 0;
}

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

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

	while(1){
		getline( cin, str );
		if( str.size()==0 ){
			break;
		}
		sscanf( str.c_str(), "%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f );

		double D  = a*e-b*d;
		double D1 = c*e-f*b;
		double D2 = a*f-d*c;

		if( D == 0.000 ){
			if( (a==0.0) && (d==0.0) ){
				x = 0.0;
				y = c/b;
			}
			if( (b==0.0) && (e==0.0) ){
				x = c/a;
				y = 0.0;
			}
		}
		else{
			x = D1 / D;
			y = D2 / D;
		}

		bool isX = ( (c-a*x)/b == (f-d*x)/e );
		bool isY = ( (c-b*y)/a == (f-e*y)/d );
		if( !isX && isY ){
			x = 0.0;
			y = c/b;
		}else if( isX && !isY ){
			y = 0.0;
			x = c/a;
		}else if( !isX && !isY ){
			x = y = 0.0;
		}

		if( x == -0.000 )	x = 0.000;
		if( y == -0.000 )	y = 0.000;

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

	return 0;
}

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

int main()
{
	for (double a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; cout << fixed << setprecision(4) << ((c*e - b*f) != 0 ? (c*e - b*f) / (a*e - b*d) : 0.0000) << ' ' << ((a*f - c*d) != 0 ? (a*f - c*d) / (a*e - b*d) : 0.0000) << endl);
	return 0;
}

C++: #include <stdio.h>
int main(){
	float a = 0,b = 0,c = 0,d = 0,e = 0,f = 0;
	float x = 0,y = 0;

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

		printf("%0.3f %0.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::cout.precision(3);
	std::cout.setf(std::ios::fixed);
	while(std::cin>>a>>b>>c>>d>>e>>f){
		double x=0.0,y=0.0;
		double a_=a,b_=b,c_=c,d_=d,e_=e,f_=f;
		b_*=d,c_*=d;
		e_*=a,f_*=a;
		y=(c_-f_)/(b_-e_);
		x=(c-y*b)/a;
		std::cout<<x<<" "<<y<<std::endl;
	}
	return 0;
}

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

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

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

using namespace std;

int main(void){
	double in;
	while(cin >> in){
		double a,b,c,d,p,q;
		double delta;
		double x,y;
		a = in;
		cin >> b;
		cin >> p;
		cin >> c;
		cin >> d;
		cin >> q;
		delta = a*d-b*c;
		x = (d*p-b*q)/delta;
		y = (-c*p+a*q)/delta;
		cout << showpoint << setprecision(4);//小数点以下3桁
		cout << round(x*1000)/1000 << " " << round(y*1000)/1000 << "\n";
	}
	return 0;
}

C++: #include <bits/stdc++.h>
// #include "bits/stdc++.h"

#define pout(n)  printf ("%d\n", n)

#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)

const int d4x[4] = {1, 0, -1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 };
 
typedef long long ll;
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-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;

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

double x, y;
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;
}