Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextFloat64() (float64, error) {
	return strconv.ParseFloat(nextString(), 64)
}

func mathRound(f float64) float64 {
	return math.Floor(f + .5)
}

func round(x float64) float64 {
	if math.Abs(x) < 0.001 {
		return 0
	}
	return mathRound(x*1000) / 1000
}

func main() {
	scanner.Split(bufio.ScanWords)
	for {
		a, err := nextFloat64()
		if err != nil {
			break
		}
		b, _ := nextFloat64()
		c, _ := nextFloat64()
		d, _ := nextFloat64()
		e, _ := nextFloat64()
		f, _ := nextFloat64()

		detA := a*e - b*d
		x := (c*e - b*f) / detA
		y := (a*f - c*d) / detA

		fmt.Printf("%.3f %.3f\n", round(x), round(y))
	}
}

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




  return 0;
}

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

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

C++: #include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int main(){
        double a,b,c,d,e,f;
        while(cin>>a,cin>>b>>c>>d>>e>>f){
           cout<<setprecision(3)<<fixed<<(f-e/b*c)/(d-e/b*a)<<" "<<(f-d/a*c)/(e-d/a*b)<<endl;
        }
	return(0);
}

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

C++: #include<stdio.h>

int main(){
	double a,b,c,d,e,f,x,y,x2,y2;
	double aa=1000,bb=1000;
	int status;
	while(1){
		status=scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
		if (status==EOF){
			break;
		}
		x=(f/e-c/b)/(d/e-a/b);
		y=c/b-a*x/b;
		x2=(b*f-c*e)/(b*d-a*e);
		y2=(c-a*x2)/b;
		
		if (b==0){
			y2=(f-d*x2)/b;
		}
		
		
		
		if (x<0.0005 && x>-0.0005){
			x=0;
		}
		if (y<0.0005 && y>-0.0005){
			y=0;
		}
	//	printf("%.3f %.3f\n",x,y);
	//	printf("%f %f\n",x,y);
		printf("%.3f %.3f\n",x2,y2);
	//	printf("%f %f\n\n\n",x2,y2);
	}
	
	return 0;
}

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

int main()
{
	double a, b, c, d, e, f, x, y;
	std::cout << std::fixed << std::setprecision(3);
	while (std::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);
		if (-0.001 < x && x < 0.001)
			x = 0;
		if (-0.001 < y && y < 0.001)
			y = 0;
		std::cout << x << " " << y << std::endl;
	}

	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<set>
#include<algorithm>
#include<map>
#include<cmath>

using namespace std;

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

	return 0;
}

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

int main(){
	int a[6];
	int x,y;
	cout<< setprecision(3) << setiosflags(ios::showpoint) << setiosflags(ios::fixed);
	while(true){
		for(int i=0;i<=5;i++)
			cin >> a[i];
			
		if(cin.eof())
			break;
			
		x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]);
			 
		cout << (double)x << " " << (double)y << endl;
	}
	return 0;
}

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

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

C++: #include <stdio.h>

int main(void)
{
	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){
		if(e*a > b*d){		
			x = (e*c - b*f) / (e*a - b*d);
			y = (d*c - a*f) / (e*a - b*d);
		}
		else{
			x = (e*c - b*f) / (b*d - e*a);
			y = (d*c - a*f) / (b*d - e*a);
		}

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

C++: #include<iostream>

using namespace std;

int main()
{
	while(1){
		int a[6];
		double detA;
		double ansx, ansy;
		
		for(int i = 0; i < 6; i++){
			cin >> a[i];
			if(a[i] == EOF){
				return 0;
			}
		}
		
		detA = ((a[0]*a[4])-(a[1]*a[3]));
		
		ansx = ((a[2]*a[4])-(a[1]*a[5]))/detA;
		ansy = ((a[0]*a[5])-(a[2]*a[3]))/detA;
		
		if(ansx == 0){
			ansx = 0;
		}
		if(ansy == 0){
			ansy = 0;
		}
		
		printf("%.4lf %.4lf\n",ansx,ansy);
	}
}

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[1000],x2[1000];
    double gyouretusiki;
    
    while((cin >> a >> b >> c >> d >> e >> f))
    {
        
        gyouretusiki = (a*e - d*b);
    
        x1[n] = (c/a) - (b/gyouretusiki)*(f -((d*c)/a));
    
        x2[n] = ((a) /(gyouretusiki))*(f-((d*c)/a));
        
        REP(i,5)
        {
            x1[n] = x1[n]*10;
            x2[n] = x2[n]*10;
        }
            x1[n] += 0.5;
            x2[n] += 0.5;
            x1[n] = (int)x1[n];
            x2[n] = (int)x2[n];
        REP(i,5)
        {
            x1[n] =x1[n]/10;
            x2[n] = x2[n]/10;
        }
        n++;
    }
    REP(i,n)
    printf("%.3f %.3f\n",x1[i],x2[i]);
    return 0;
    
}

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

int main(){
	cout << fixed << setprecision(3);
	double a,b,c,d,e,f;
	double x,y;
	cin >> a >> b >> c >> d >> e >> f;
	y = ((d * c) - (a * f)) / ((d * b) - (a * e)) ;
	x = (c - (b * y)) / a;

	cout << x << " " << y << "\n";

}

C++: #include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
	long a,b,c,d,e,f;
	long o,p,q,r,s,t;
	double x,y;
	for(int i=0;i<2;i++){
		scanf("%ld%ld%ld%ld%ld%ld",&a,&b,&c,&d,&e,&f);
		o=a;p=b;q=c;r=d;s=e;t=f;
		o*=d;p*=d;q*=d;
		r*=a;s*=a;t*=a;
		//printf("%d %d %d %d %d %d \n",o,p,q,r,s,t);
		p-=s;
		q-=t;
		if(q==0){
			y=0.0;
		}
		else{
		y=(float)(q/p);
		}
		int g=(int)(e*y);
		g*=-1;
		if(f+g==0){
			x=0.0;
		}
		else{
			x=(float)((f+g)/d);
		}
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

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

using namespace std;

/*
aX+bY=c
dX+eY=f
*/

void solve(int a, int b, int c, int d, int e, int f) {
	double x = (f - (double)e*c/b) / (d - (double)e*a/b);
	double y = (c - a*x) / b;
	if (x == 0) x = 0.000;
	if (y == 0) y = 0.000;
	printf("%4.3f %4.3f\n", x, y);
}

int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		solve(a,b,c,d,e,f);
	}
	return 0;
}

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

int main(){
  int a, b, c, d, e, f;
  scanf("%d ",&a);
  scanf("%d ",&b);
  scanf("%d ",&c);
  scanf("%d ",&d);
  scanf("%d ",&e);
  scanf("%d ",&f);
  
  double x, y;
  x = (double)(c*e-b*f) / (double)(a*e-b*d);
  y = (double)(a*f-c*d) / (double)(a*e-b*d);
  x = (double)round(x*10000.0) / 10000.0;
  y = (double)round(y*10000.0) / 10000.0;
  printf("%.3f %.3f\n", x, y);
  
  return 0;
}