Go: package main

import "fmt"

func main() {

	for {
		var a, b, c, d, e, f float64
		var x, y float64
		i, _ := fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if i != 6 {
			return
		}

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

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

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define debug(n) cout<<"# "<<#n<<": "<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

const double EPS=1e-10;

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

    cout.setf(ios::showpoint);
    cout.precision(4);
    if (x == 0) x = 0;
    if (y == 0) y = 0;
    cout << x << ' ' << y << endl;

  }
  return 0;
}

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

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

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

		int x = (b * f - c * e) / (b * d - a * e);	//?????¶???????????£??????
		int y = (c * d - a * f) / (b * d - a * e);		//?????¶???????????£??????

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

	for (int i = 0; i < x_vector.size(); i++) {
		cout << x_vector[i] << " " <<  y_vector[i] << endl;
	}

	while (1);

	return 0;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
constexpr double eps = 1e-8;

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

C++: #include <iostream>
using namespace std;
int main(){
	double a,b,c,d,e,f,g;
	double x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		g=a*e-b*d;
		x=(c*e-b*f)/g;if(!x)x=0;
		y=(a*f-c*d)/g;if(!y)y=0;
		printf("%.3f %.3f",x,y);
	}
}

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

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 =(double)((e*c-b*f)/(a*e-b*d));
    y = (double)((-(d*c)+a*f)/(a*e-b*d));
    if(y == 0)y = 0;

    if(x == 0) x = 0;
    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

C++: #include<cstdio>
using namespace std;
int main(){
	for(;;){
		double matrix[2][2],reverse[2][2],ans[2],x,y,det;
		if(scanf("%lf %lf %lf %lf %lf %lf",&matrix[0][0],&matrix[1][0],&ans[0],&matrix[0][1],&matrix[1][1],&ans[1]) == EOF){break;}
		det = matrix[0][0]*matrix[1][1]-matrix[0][1]*matrix[1][0];
		reverse[0][0] = matrix[1][1]/det;
		reverse[1][0] = -matrix[1][0]/det;
		reverse[0][1] = -matrix[0][1]/det;
		reverse[1][1] = matrix[0][0]/det;
		x = ans[0]*reverse[0][0]+ans[1]*reverse[1][0];
		y = ans[0]*reverse[0][1]+ans[1]*reverse[1][1];
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

C++: #include <cstdio>

int main (int argc, char *argv[]) {
	using namespace std;
	int a, b, c, d, e, f;
	while (EOF != fscanf(stdin, "%d %d %d %d %d %d\n", &a, &b, &c, &d, &e, &f)) {
		float tmp1 = static_cast<float>(f)-(static_cast<float>(c)*static_cast<float>(d)/static_cast<float>(a));
		float tmp2 = static_cast<float>(e)-(static_cast<float>(b)*static_cast<float>(d)/static_cast<float>(a));
		float y = tmp1/tmp2;
		float x = (static_cast<float>(c) - static_cast<float>(b) * y) / static_cast<float>(a);
		printf("%f %f\n", x, y);		
		//printf("y=%f\n", (f-(c*d/a))/(e-(b*d/a)));
	}
	
	return 0;
}

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

using namespace std;

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

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

C++: /*
    AOJ Volume0 0003

    Simultaneous Equation

    Write a program which solve a simultaneous equation:
        ax+by=c
        dx+ey=f

    The program should print x and y for given 
    a, b, c, d, e and f (-1,000 ≤ a,b,c,d,e,f ≤ 1,000).
    You can suppose that given equation has a unique solution.
    
    Input
        The input consists of several data sets, 1 line for each data set.
        In a data set, there will be a,b,c,d,e,f separated by a single space.
        The input terminates with EOF.

    Output
        For each data set, print x and y separated by a single space.
        Print the solution to three places of decimals. Round off the solution to three decimal places.

    Sample Input 1
        1 2 3 4 5 6
        2 -1 -2 -1 -1 -5

    Output for the Sample Input 1
        -1.000 2.000
        1.000 4.000

    Sample Input 2
        2 -1 -3 1 -1 -3
        2 -1 -3 -9 9 27

    Output for the Sample Input 2
        0.000 3.000
        0.000 3.000


*/

#include <iostream>
#include <iomanip>

int main(void)
{

    while(true)
    {
        double a,b,c,d,e,f;
        if(std::cin >> a >> b >> c >> d >> e >> f)
        {
            double rate = d / a; 
            double 
                a2 = a * rate,
                b2 = b * rate,
                c2 = c * rate;

            double
                d2 = d - a2,  // defintly 0
                e2 = e - b2,
                f2 = f - c2;

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

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

        else break;
    }

    return 0;

}

C++: #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
constexpr double eps = 1e-9;
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>
int gcd(int x,int y){
	if(y==0)return x;
	else return gcd(y,x%y);
}
int main(){
	while(1){
		double a,b,c,d,e,f;
		std::cin>>a>>b>>c>>d>>e>>f;
		double b2=b*gcd(a,d)/a;
		double e2=e*gcd(a,d)/d;
		double c2=c*gcd(a,d)/a;
		double f2=f*gcd(a,d)/d;
		double y=(f2-c2)/(e2-b2);
		double x=(e-b*y)/a;
		std::cout<<x<<" "<<y<<std::endl;
		break;
	}
	return 0;
}