Go: package main

import (
	"fmt"
)

func main() {
	for {
		var a, b, c, d, e, f float64
		i, _ := fmt.Scan(&a, &b, &c, &d, &e, &f)
		if i == 0 {
			break
		}

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

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

C++: #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
int main(){
	cout<<shosu(3);
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double tmp=a*e-b*d;
		double ansx=(c*e-b*f)/tmp;
		double ansy=(a*f-c*d)/tmp;
		if(ansx==-0) ansx=0;
		if(ansy==-0) ansy=0;
		cout<<ansx<<' '<<ansy<<endl;
	}
}

C++: #include <stdio.h>
#include <math.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/a-f/d)/(b/a-e/d);
		x = c/a-b/a*y;
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

C++: #include <stdio.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

void print(double x, double y) {
    if (x == -0.0) x = 0;
    if (y == -0.0) y = 0;
    printf("%.3f %.3f\n", x, y);
}

int main() {
    double a, b, c, d, e, f;
    while (scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF) {
        if (d == 0) {
            const double y = f / e;
            const double x = (c-b*y) / a;
            print(x, y);
        }
        else {
            const double y = (c-a*f/d) / (b-a*e/d);
            const double x = (f-e*y)/d;
            print(x, y);
        }
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
	double a,b,c,d,e,f,n[20];
	while(cin>>a>>b>>c>>d>>e>>f){
	double x,y;
	int w;
	if(a == 0){
		n[0] = 0;
		n[1] = 0;
	}else{
		n[0] = c / a;
		n[1] = b / a;
	}
	if(d == 0){
		n[2] = 0;
		n[3] = 0;
	}else{
		n[2] = f / d;
		n[3] = e / d;
	}
	if(b == 0){
		n[4] = 0;
		n[5] = 0;
	}else{
		n[4] = c / b;
		n[5] = a / b;
	}
	if(e == 0){
		n[6] = 0;
		n[7] = 0;
	}else{
		n[6] = f / e;
		n[7] = d / e;
	}
	if(n[1] - n[3] == 0){
		y = 0;
	}else{
		y = (n[0] - n[2]) / (n[1] - n[3]);
	}
	if(n[5] - n[7] == 0){
		x = 0;
	}else{
		x = (n[4] - n[6]) / (n[5] - n[7]);
	}
	x = x * pow(10, - 5);
	double xx = x + 0.5;
	xx = xx * pow(10,5);
	y = y * pow(10, - 5);
	double yy = y + 0.5;
	yy = yy * pow(10,5);

	printf("%04f,%04f\n",&xx,&yy);



}
return 0;
}

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

int main() {
  float a,b,c,d,e,f;
  float x,y;

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

  if(a >= d && fmodf(a, d) == 0) {
    y = (c - (f * (a / d))) / (b - (e * (a / d)));
    x = (c - (b * y)) / a;
  }
  else if(a < d && fmodf(d, a) == 0) {
    y = (f - (c * (d / a))) / (e - (b * (d / a)));
    x = (c - (b * y)) / a;
  }
  else if(b >= e && fmodf(b, e) == 0) {
    x = (c - (f * (b / e))) / (a - (d * (b / e)));
    y = (c - (a * x)) / b;
  }
  else if(b < e && fmodf(e, b) == 0) {
    x = (f - (c * (e / b))) / (d - (a * (e / b)));
    y = (c - (a * x)) / b;
  }
  else {}

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

  return 0;
}

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

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

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

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

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

using namespace std;

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

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

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


int main(void) {
    double a, b, c, d, e, f;
    
    while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF) {
        double ya = d * c - a * f;
        double yb = b * d - a * e;
        double y = ((yb == 0) ? 0.0 : ((ya) / (yb)));
        
        double x = (a == 0) ? 0 : ((c - b * y) / a);
        printf("%.3f %.3f",x, y);
        
    }
    
    return(0);
}

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

using namespace std;

int main(){
    int a,b,c,d,e,f;
    double X[6] = {};
    
    for(int i=0;i<6;i++)
    cin >> X[i];
    
    double y = ( X[2] * X[3] - X[0] * X[5]) / ( X[1] * X[3] - X[0] * X[4] );

    if( X[0] !=0 )
    cout << fixed << setprecision(3) << (X[2] - X[1] * y) / X[0] << " " << y << "\n";
    
    else
    cout << fixed << setprecision(3) << (X[5] - X[4] * y) / X[3] << " " << y << "\n";
}

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

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <cstring>
#include <climits>
#include <queue>
using namespace std;

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-6

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