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

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

C++: #include <stdio.h>

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

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

double r(double d){
  roundl(d*1000)/1000;
}

int main(){
  double a,b,c,d,e,f;
  while(~scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f))
    printf("%.3f %.3f",r((c*e-b*f)/(a*e-b*d)),r((-c*d+a*f)/(a*e-b*d)));
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  double a,b,c,d,e,f,a2,b2,c2,d2,e2,f2,e3; // ax+by=c  dx+ey=f
  while(cin >> a >> b >> c >> d >> e >> f){
    a2=a;
    b2=b;
    c2=c;

    a/=b;
    c/=b;
    a*=(-1);
    c*=e;
    a*=e;
    a+=d;
    f-=c;
    double ansx=f/a;
    printf("%.3f ",ansx);
 
    a2*=ansx;
    c2-=a2;
    double ansy=c2/b2;
    printf("%.3f\n",ansy);
  }
  return 0;
}

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

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

C++: #include<iostream>
using namespace std;
int main()
{
	double a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f)
	{
		cout<<(e*c-b*f)/(a*e-b*d)<<" "<<(a*f - c*d) / (a*e - b*d) << endl;
	}
	return 0;
}

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

using namespace std;

int main()
{
	double a,b,c,d,e,f;
	double x,y;
	double D;
	
	while ( (cin >> a) && (cin >> b) && (cin >> c) && (cin >> d) && (cin >> e) && (cin >> f) ) {
		D = a*e - b*d;
		x = (e*c - b*f) / D;  x+=0;
		y = (-d*c + a*f) / D; y+=0;

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

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

int main()
{
    double a,b,c,d,e,f;
    
    while(cin >> a >> b >> c >> d >> e >> f)
    {


    double A = a*e-b*d;
    double ans1, ans2;
    ans1 = (c*e - b*f)/A;
    ans2 = (-c*d + a*f)/A;
    if(ans1<0.0005 && ans1> -0.0005) ans1 = 0;
    if(ans2<0.0005 && ans2> -0.0005) ans2 = 0;

    printf("%1.3f %1.3f\n",ans1,ans2);
    }
    return 0;
}

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


using namespace std;

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

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



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

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

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

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

	return 0;
}

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

int main() {
	int a, b, c, d, e, f;
	int cnt = 0;
	std::vector<double> x_vector;
	std::vector<double> y_vector;

	while (cin >> a >> b >> c >> d >> e >> f) {
	//???????????°
	/*
	while (!cnt) {
		cnt++;
		cin >> a >> b >> c >> d >> e >> f;
	*/
	//end ??????????????°
		double x = (b * f - c * e) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);

		x_vector.push_back(x);
		y_vector.push_back(y);
	}

	for (unsigned int i = 0; i < x_vector.size(); i++) {
		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>
#include<cstdio>
using namespace std;
int main()
{
  double a,b,c,d,e,f;
  while( cin >> a >> b >> c >> d >> e >> f ){
    double y = (a*f - c*d) / (a*e - b*d);
    double x = (c - b*y) / a;
    if(x == -0) x = 0;
    if(y == -0) y = 0;
    printf("%.3lf %.3lf\n", x, y);
  }

  return 0;
}

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

int main(){
double a,b,c,d,e,f,a_,b_,c_,d_,e_,f_;
double x,y;
double in;
while (std::cin >>a>>b>>c>>d>>e>>f){
in = (a*e - b*d);
a_ = a/in;
b_ = -1*d/in;
d = -1*b/in;
e_ = e/in;
x = c * a_ + f*b_;
y = c*d_ + f*e_;
std::cout << std::setprecision(3) << std::fixed << x << ' ' << std::setprecision(3) <<std::<<fixed <<  y << std::endl;
}
    return 0;
}

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

int main(){
	int a,b,c,d,e,f;
	while(std::cin>>a>>b>>c>>d>>e>>f){
		double x,y;
		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, x, y; //連立方程式の各係数

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

    if(x == -0){
      x = 0.0;
    }
    if(y == -0){
      y = 0.0;
    }

    printf("%.3f %.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::cin>>a>>b>>c>>d>>e>>f;
	float x,y;
	int a_=a,b_=b,c_=c,d_=d,e_=e,f_=f;
	b_*=GCM(a,d)/a,c_*=GCM(a,d)/a;
	e_*=GCM(a,d)/d,f_*=GCM(a,d)/d;
	y=(c_-f_)/(b_-e_);
	x=(c-y*b)/a;
	std::cout<<x<<" "<<y<<std::endl;
	return 0;
}

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

auto main () -> int
{
    double a , b , c , d , e , f;
    while (std::cin >> a >> b >> c >> d >> e >> f)
    {
        auto delta = a * e - b * d;
        auto x = (e * c - b * f) / delta;
        auto y = (- c * d + a * f) / delta;
        std::printf ("%.3f %.3f\n" , x , y);
    }
}

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

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

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

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

using namespace std;
 
#define N 2

int main(void)
{
	double a[N][N+1];
	int i, j, k;
	for( i=0; i<N; i++ ){
		for( j=0; j<N+1; j++ ){
			cin >> a[i][j];
		}
	}

	double p, d;
	for( k=0; k<N; k++ ){
		p = a[k][k];
		for( i=0; i<N+1; i++ )
			a[k][i] /= p;
		for( i=0; i<N; i++ ){
			if( i != k ){
				d = a[i][k];
				for( j=0; j<N+1; j++ ){
					a[i][j] -= a[k][j]*d;
				}
			}
		}
	}

	cout << setprecision(3) << setiosflags(ios::fixed);
	cout << a[0][N] << " " << a[1][N] << endl;

	return 0;
}