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 "bits/stdc++.h"
using namespace std;
int main(){
    double a, b, c, d, e, f;
    while(cin >> a >> b >> c >> d >> e >> f){
        double M[2][3] = { 
            {a, b, c},
            {d, e, f}
        };
        double d = 0, m = 0;
        for(int i=0; i<2; ++i)
        {  
            d = M[i][i];
            for(int j=0; j<3; ++j){
                M[i][j] = M[i][j] / d;
            }
            for(int k = i+1; k<2; k++){
                m = M[k][i];
                for(int n = i; n<3; ++n){
                    M[k][n] = M[k][n] - m * M[i][n];
                }
            }
        }
        
        for(int i = 1; i>0; --i){
            for(int j= i-1; j>=0; --j){
                d = M[j][i];
                for(int n=i; n<3; ++n){
                    M[j][n] = M[j][n] - d * M[i][n];
                }
            }
        }
        for(int i=0; i<2; i++){
            if(i == 1) {
                printf("%.3lf\n", M[i][2]); break;
            }
            printf("%.3lf ", M[i][2]);
            
        }
    }
    return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<math.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

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

C++: #include<stdio.h>
#define rep(i,m,n) for(i = m;i < n;i++)
int main(){
	int a[6],i;
	int kcor = 0;
	double kx[1000] = {0},ky[1000] = {0};
	while(scanf("%d",a)!=-1){
		rep(i,1,6)
			scanf("%d",a+i);
		int det;
		det = a[0]*a[4]-a[1]*a[3];
		kx[kcor] = (a[4]*a[2]-a[1]*a[5])/(double)det;
		ky[kcor] = (-a[3]*a[2]+a[0]*a[5])/(double)det;
		kcor++;
	}
	rep(i,0,kcor){
		printf("%.3lf %.3lf\n",kx[i],ky[i]);
		//printf("%lf %lf\n",kx[i],ky[i]);
	}
	return 0;
}

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

int main(){
    int a[100]={0};
    int b[100]={0};
    int c[100]={0};
    int d[100]={0};
    int e[100]={0};
    int f[100]={0};
    int i=0;
    while(cin>>a[i]>>b[i]>>c[i]>>d[i]>>e[i]>>f[i]){
        i++;
        }
    for(int j=0;j<i;j++){
        float x=(b[j]*f[j]-e[j]*c[j])/(b[j]*d[j]-a[j]*e[j]);
        float y=(a[j]*f[j]-c[j]*d[j])/(a[j]*e[j]-b[j]*d[j]);
        cout<<setiosflags(ios::fixed)<<setprecision(3)<<x<<" "<<y<<endl;
        }
    
    return 0;
}

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

using namespace std;

int main()
{
    double a, b, c, d, e, f;
    double answer1, answer2;

    while (cin >> a >> b >> c >> d >> e >> f) {
        answer1 = static_cast<double>(e * c - b * f) / (a * e - b * d);
        answer2 = static_cast<double>(-d * c + a * f) / (a * e - b * d);
        if (answer1 == 0) answer1 = 0.000;
        if (answer2 == 0) answer2 = 0.000;
        cout << fixed << setprecision(3) << round(answer1) << " " << round(answer2) << endl;
    }
    
    return 0;
}

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

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

  while(cin>>a>>b>>c>>d>>e>>f){

  m = a;
  n = d; 

  a *= n;
  b *= n;
  c *= n;

  d *= m;
  e *= m;
  f *= m;
  
  y = (double)((c-f)/(b-e));

  x = (double)((c-b*y)/a);

  if(x==0)
    x = 0;
  if(y==0)
    y = 0;

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

  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <cmath>
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--)
#define ALL(a) (a).begin(),(a).end()

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

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

}

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


double a,b,c,d,e,f;
double A,B,C,D;
int main(){
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) !=EOF){
    if(a == 0){
      A =c/b;
      B = (f-e*A)/d;
      }
    if(b == 0){
      B = c/a;
      A = (f-d*B)/e;
    }
    if(d == 0){
      A =f/e;
      B = (c-b*A)/a;
    }
    if(e == 0){
      B =f/c;
      A =(c -a*B)/b;
    }
    if( a != 0&& b!=0&& d!=0 &&e!=0){
      b/=a;
      c/=a;
      a/=a;
      
      e/=d;
      f/=d;
      d/=d;
      A =(c-f)/(b-e);
      B =(c-b*A);
    }
    
    A =floor((A+0.0005)*1000)/1000;//小数第4位を四捨五入
    B =floor((B+0.0005)*1000)/1000;
    printf("%.3f %.3f\n",B,A);
  }
  return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <vector>
using namespace std;

int main(int argc, char const *argv[]) {
  double x, y;
  double a, b, c, d, e, f;
  while (!(cin >> a >> b >> c >> e >> f >> d).eof()) {
    x = (f * c - b * d) / (a * f - b * e);
    y = (a * d - c * e) / (a * f - b * e);
    std::cout << fixed << setprecision(3) << x << " " << y << '\n';
  }
  return 0;
}

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

constexpr double eps = 1e-8;

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

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

using namespace std;

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

int main(){
	while(cin >> a >> b >> c >> d >> e >> f){
		printf("%0.3lf ",(c/a)-((b*c*d-a*b*f)/(a*b*d-a*a*e)));

		printf("%0.3lf\n",(c*d-a*f)/(b*d-a*e));
	}
    return 0;
}