Go: package main

import "fmt"

func main() {
	var resultX, resultY [100]float32
	var count 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
		}
		//Simultaneous equation
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		resultX[count] = x
		resultY[count] = y
		count++
	}
	for i := 0; i < count; i++ {
		fmt.Printf("%.3f %.3f\n", resultX[i], resultY[i])
	}
}

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

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

	while (1) {
		cin>>a>>b>>c>>d>>e>>f;
		if (cin.eof()) break;

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

		printf("%5.3lf %5.3lf\n", x, y);
		//cout<<setprecision(4)<<setiosflags(ios::fixed)<<x<<" "<<y<<endl;
	}

	return 0;
}

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

int main(){
	
	double a,b,c,d,e,f;
	
	while(cin >> a >> b >> c >> d >> e >> f){
		double x,y;
		
		x = ((c*e)-(b*f))/((a*e)-(b*d));
		y = ((a*f)-(c*d))/((a*e)-(b*d));
		
		x *= 1000;
		y *= 1000;
		
		round(x);
		round(y);
		
		x /= 1000;
		y /= 1000;
		
		cout << fixed << setprecision(3) << 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 x = (c/b - f/e) / (a/b - d/e);
    double y = (c - a*x) / b;
    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() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double x = (e * c - b * f) / (e * a - b * d);
        double y = (c - a * x) / b;
        cout << fixed << setprecision(4) << x << " " << y << "\n";
    }
}

C++: #include<iostream>

using namespace std;
int main(){

  double a, b, c, d, e, f;
  double x, y;
  cin >> a >> b >> c >> d >> e >> f;
  x = (c * e - b * f) / (a * e - b * d);
  y = (a * f - c * d) / (a * e - b * d);
  cout << x << " " << y << endl;
  return 0;
}

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

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

C++: #include <bits/stdc++.h>

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(12);
  double a, b, c, d, e, f, x, y, tmp_h, tmp_l;
  while (cin >> a >> b >> c >> d >> e >> f) {
    tmp_h = (b * e) / b, tmp_l = (b * e) / e;
    a *= tmp_h, b *= tmp_h, c *= tmp_h, d *= tmp_l, e *= tmp_l, f *= tmp_l;
    x = (c - f) / (a - d);
    y = (c - a * x) / b;
    if (x == -0) {
      x = 0.0;
    }
    if (y == -0) {
      y = 0.0;
    }
    cout << x << ' ' << y << '\n';
  }
  return 0;
}

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

using namespace std;

int main(){
  double a,b,c,d,e,f;
  vector<double> al,bl,cl,dl,el,fl;
  double x,y,n,m;

  while(cin >> a >> b >> c >> d >> e >> f){
    al.push_back(a);
    bl.push_back(b);
    cl.push_back(c);
    dl.push_back(d);
    el.push_back(e);
    fl.push_back(f);
  }

  for(int i=0; i<al.size(); i++){
    n = b/e;
    m = a/d;
    x = (c-n*f)/(a-n*d); 
    y = (c-m*f)/(b-m*e);
    printf("%0.3f %0.3f\n", x, y);
  }

  return 0;
}

C++: const int tt = 10000;

#include<iostream>
#include<string>
#include<sstream>
using namespace std;

string toStr(int n);
string intToString(int n);

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

    int det = a * e - b * d;

    int x = ( e * c - b * f) / det;
    int y = (-d * c + a * f) / det;
//    cout << x << y << endl;

    cout << toStr(x) << " " << toStr(y) << endl;
  }
}

string toStr(int n) {
  string pm, val;
  
  if (n < 0) {
    pm = "-";
    n = -n;
  } else {
    pm = "";
  }

  int ipart = n / tt;
  int fpart = (n - ipart * tt) + tt + 5;

  val = pm + intToString(ipart) + "." + intToString(fpart).substr(1, 3);
  return val;
}

string intToString(int n) {
  stringstream ss;
  ss << n;
  return ss.str();
}

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

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

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

double sisya(double x)
{
	int a = static_cast<int>(x) * 10000;
	if(a < 0)
		a = -a;
	if(a%10 > 4)
		return x+0.001;
	return x;
}

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

C++: import java.util.Scanner;

public class Main {
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
			double a = sc.nextDouble();
			double b = sc.nextDouble();
			double c = sc.nextDouble();
			double d = sc.nextDouble();
			double e = sc.nextDouble();
			double f = sc.nextDouble();
					   b = b*d;
					   c = c*d;
					   e = e*a;
					   f = f*a;

					double y = (c-f)/(b-e);
					double x = (c-(b*y))/(a*d);
					x = (int)((x * 1000)+0.5);
					y = (int)((y * 1000)+0.5);
			System.out.println((double)x/1000 +" "+ (double)y/1000);
	}
}

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;
	if(y == 0) y = 0;
	if(x == 0) x = 0;

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

}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define MOD 1000000007 //10^9+7
#define INF 1000000000 //10^9

pair<double, double>equ2(int a,int b,int c,int d,int e,int f){
    double det=1.0/(a*e-b*d);
    double x=(double)(c*e-b*f)*det;
    double y=(double)(a*f-c*d)*det;
    return pair<double, double>(x,y);
}

int main ()
{
    string str;
    while (!cin.eof()) {
        int a,b,c,d,e,f;
        
        cin>>a>>b>>c>>d>>e>>f;
        
        pair<double,double> ans=equ2(a,b,c,d,e,f);
        
        cout<<ans.first<<' '<<ans.second<<endl;
    }
}

C++: #include <iostream>
#include <iomanip>
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);

		cout<<fixed<<setprecision(3)<<X<<" "<<fixed<<setprecision(3)<<Y<<endl;
	}

	return 0;
}