Go: package main

import "fmt"

func main() {
	var Xs, Ys []float32
	Xs = make([]float32, 0)
	Ys = make([]float32, 0)
	var cnt int
	for {
		var a, b, c, d, e, f, x, y float32
		fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if a == 0 {
			break
		}
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		Xs = append(Xs, x)
		Ys = append(Ys, y)
		cnt++
	}
	for i := 0; i < cnt; i++ {
		fmt.Printf("%.3f %.3f\n", Xs[i], Ys[i])
	}
}

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

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		G = A / D;
		D *= G;
		E *= G;
		F *= G;
		Y = (F-C) / (E-B);
		
		D /= G;
		E /= G;
		F /= G;
		H = B / E;
		D *= H;
		E *= H;
		F *= H;
		X = (F-C) / (D-A);

		if(Y==0){
			Y=0.000;
		}

		if(X==0){
			X=0.000;
		}

		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;
    while(cin >> a >> b >> c >> d >> e >> f)
        printf("%.3f %.3f\n",((e*c-b*f)/(a*e-b*d)==-0.0? 0.0:(e*c-b*f)/(a*e-b*d)),((a*f-c*d)/(a*e-b*d)==-0.0? 0.0:(a*f-c*d)/(a*e-b*d)));
    return 0;
}

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

double det(double a, double b, double c, double d){
	return a*d - b*c ;
}

int main() {
	// your code goes here
	
	double a,b,c,d,e,f;
	double x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		x=det(c,b,f,e)/det(a,b,d,e);
		y=det(a,c,d,f)/det(a,b,d,e);
		if(x==0){x=0;}  if(y==0){y=0;}
		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(void){
	
	double x, y;
	int a, b, p;
	int c, d, q;

	while (cin >> a >> b >> p >> c >> d >> q){

		x = (double)(p * d - b * q) / (a * d - b * c);
		y = (double)(a * q - p * c) / (a * d - b * c);
		printf("%.3f %.3f\n", x, y);
	}
}

C++: #include <cstdio>

using namespace std;

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

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

    return 0;
}

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

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

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

C++: #pragma GCC optimize("Ofast,unroll-loops")
#include<bits/stdc++.h>

using namespace std;
using Int = long long;
typedef pair<int,int> Pi; typedef pair<Int,Int> Pl;
constexpr int mod = 1e9+7;
constexpr int INF32 = numeric_limits<int>::max();
constexpr Int INF64 = numeric_limits<Int>::max();
#define END {cout<<ans<<'\n'; return 0;}
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define mp make_pair
#define eb emplace_back
#define Pr(t) priority_queue<t>
#define gPr(t) priority_queue<t,vector<t>,greater<t>>
#define V(t) vector<t>
#define rer(i,l,r) for(int(i)=(l); (i)<(r); ++(i))
#define rep(i,n) rer(i,0,n)
#define gnr(i,l,r) for(int (i)=(r)-1; (i)>=(l); --(i))
#define pri(a) cout<<(a)<<'\n'
#define pri2(a,n) {rep(i,n-1)cout<<a[i]<<' '; if(n)cout<<a[n-1]<<'\n';}
#define prip(p) cout<<(p).fi<<' '<<(p).se<<'\n'
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n,m,_,x,y,q;
string s,sb;
bool ok;
char cf,cb;

int main(){
  cin.tie(nullptr); ios::sync_with_stdio(0);
  //cout<<fixed<<setprecision(20);
  
  double a,b,c,d,e,f;
  while(cin>>a>>b>>c>>d>>e>>f){
    double ay=(a*f-c*d)/(a*e-b*d),ax=(c-b*ay)/a;
    printf("%.3f %.3f\n",ax,ay);
  }
}

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

using namespace std;

int main(){
	int a, b, c, a2, b2, c2;
	int i, j;

	while(cin >> a >> b >> c >> a2 >> b2 >>c2){
		for(i = -1000; i <= 1000; i++){
			for(j = -1000; i <= 1000; i++){
				if(a*i + b*j == c && a2*i + b2*j == c2){
					cout << fixed << setprecision(3)  << i << " " << j << endl;
				}
			}
		}
	}
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#define N 2

using namespace std;
typedef vector< vector<double> > const_vector;

bool input(const_vector& c)
{
	for (int i = 0; i < N; ++i)
		for (int j = 0; j < N + 1; ++j)
			cin >> c[i][j];

	return true;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	const_vector c(N, vector<double>(N + 1));
	while (input(c))
	{
		// ??¬??????????¶???????
		// ???????¶????
		for (int i = 0; i < N - 1; ++i)
			for (int j = i + 1; j < N; ++j)
			{
				double d = c[j][i] / c[i][i];
				for (int k = i + 1; k <= N; ++k)
					c[j][k] -= c[i][k] * d;
			}

		// ????????£??\
		for (int i = N - 1; i >= 0; --i)
		{
			double d = c[i][N];
			for (int j = i + 1; j < N; ++j)
				d -= c[i][j] * c[j][N];
			c[i][N] = d / c[i][i];
		}

		// ????????????
		cout << setprecision(4) << fixed << c[0][N];
		for (int i = 1; i < N; ++i)
			cout << " " << c[i][N];
		cout << endl;
	}

	return 0;
}

C++: #include<iostream>
//#include<algorithm>
//#include<cmath>
//#include<string>
//#include<cctype>
//#include <vector>
using namespace std;
int main(){
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		double x = (c*d - a*f) / (b*d - a*e);
		printf("%.3f %.3f\n", (c - b*x) / a, x);
	}
	return 0;
}

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

int main() {
	// your code goes here

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

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

    double x = (c*e-b*f)/(double)(a*e-b*d);
    double y = (c*d-a*f)/(double)(b*d-a*e);
    if(x == -0.0 || y == -0.0){
      x = 0.0;
      y = 0.0;
    }

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

  }
	return 0;
}

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

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

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

    y = (c*d - f*a)/(b*d-e*a);
    x = (c - b*y)/a;
    
    
    x*=10000;
    y*=10000;
    
    x+=0.5;
    y+=0.5;
    
    x/=10000;
    y/=10000;
    
    //cout << x << y << endl;
    printf("%.3f %.3f\n", x, y);
  }

  return 0;
}

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

int main(){
	int 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*d-a*f)/(b*d-a*e);
		printf("%.3f %.3f\n", x, y);
	}
}

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

int main(){
	float a,b,c,d,e,f,i,n;
	while(cin >> a >> b >> c >> d >> e >> f){
		printf("%6.3f %6.3f\n",(c*e-b*f)/(a*e-b*d) ,(c*d-a*f)/(b*d-a*e));
	}
	return 0;
}

C++: #include <stdio.h>
float round3(float a){
	a=a*10000;
	if(int(a)%10>5)a+10;
	a=double (int (a));
	a=a/10000;

}
int main(){
	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(a*e==b*d){
		}else{
			x=(c*e-b*f)/(a*e-b*d);
			y=(c*d-a*f)/(b*d-a*e);
		}
		x=round3(x);
		y=round3(y);
		printf("%0.3lf %0.3lf\n",x,y);
	}
	return 0;
}