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<algorithm>
#include<stdio.h>
using namespace std;
int main(){
	int a,b,c,d,e,f;
	int o,p,q,r,s,t;
	float x,y;
	for(int i=0;i<2;i++){
		scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
		o=a;p=b;q=c;r=d;s=e;t=f;
		o*=d;p*=d;q*=d;
		r*=a;s*=a;t*=a;
		//printf("%d %d %d %d %d %d \n",o,p,q,r,s,t);
		p-=s;
		q-=t;
		y=(float)(q/p);
		int g=(int)(e*y);
		g*=-1;
		x=(float)((f+g)/d);
		printf("%.3 %.3f",x,y);
	}
}

C++: #include<iostream>
#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 = (e*c-b*f) / (a*e-b*d);
    y = (-(d*c)+a*f) / (a*e-b*d);
  printf("%1.3f %1.3f\n",x,y);
 }
}

C++: #include<cstdio>

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) + 1){
		x = ( e * c - b * f) / ( a * e - b * d);
		y = ( - d * c + a * f) / ( a * e - b * d);
		printf("%.4f %.4f\n", x, y);
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int s = 100000;
	int n;
	cin >> n;
	while (n--) {
		if (int(s*1.05) % 1000 == 0) {
			s = int(s*1.05);
		}
		else {
			s = int(s*1.05) + (1000 - int(s*1.05) % 1000);
		}
	}
	printf("%d\n", s);
    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){
		float detab = a*e-b*d;
		float deta = c*e-b*f;
		float detb = a*f-c*d;
		float x = deta/detab;
		float y = detb/detab;
		if(x == -0)
			x = 0;
		if(y == -0)
			y = 0;
		cout << fixed << setprecision(3);
		cout << x << " " << y << endl;
	}
}
//1 2 3 4 5 6
//2 -1 -2 -1 -1 -5
//2 -1 -3 1 -1 -3
//2 -1 -3 -9 9 27

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <numeric>
#include <string>
#include <vector>
#include <list>
#include <iterator>

#include <cstdio>
#include <cmath>

#define DIM 2
#define EPS (5*10e-4)

typedef std::vector<double> Vec;
typedef std::vector<Vec> Mat;
typedef std::pair<Mat,Vec> Eq;

double removeMinusZero(double x){
	if ( fabs(x)< EPS ){
		return 0.0;
	}
	else {
		return x;
	}
}

int main(void){
	using namespace std;

	list<Eq> input;

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

	cout << fixed << setprecision(3);

	while(cin >> a >> b >> c >> d >> e >> f){
		Vec m1, m2;
		m1.push_back(a);
		m1.push_back(b);
		m2.push_back(d);
		m2.push_back(e);

		Vec vec;
		vec.push_back(c);
		vec.push_back(f);

		Mat mat;
		mat.push_back(m1);
		mat.push_back(m2);

		Eq eq = make_pair(mat,vec);

		input.push_back(eq);
	}

	for(auto itr = input.begin(); itr!=input.end(); ++itr){
		auto mat = itr->first;
		auto vec = itr->second;

		Vec output(DIM);

		double det = mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0];
		// std::transform(vec.begin(), vec.end(),vec.begin(), std::bind1st(multiplies<double>(),1.0/det));

		mat[0][1] = -mat[0][1];
		mat[1][0] = -mat[1][0];
		swap(mat[0][0],mat[1][1]);

		for (int i=0; i<DIM; i++){
			output[i] = inner_product(vec.begin(), vec.end(), mat[i].begin(), 0);
		}
		std::transform(output.begin(), output.end(),output.begin(), std::bind1st(multiplies<double>(),1.0/det));
		cout << removeMinusZero(output[0]) << " " << removeMinusZero(output[1]) << endl;
	}

}

C++: #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
typedef vector<int> VI;
#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    vector<pair<double, double>> answers;

    double a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        pair<double, double> ans;
        ans.first = (e * c - b * f) / (a * e - b * d) + 0.0;
        ans.second = (a * f - d * c) / (a * e - b * d) + 0.0;
        answers.push_back(ans);
    }

    for (auto ans : answers) {
        cout.setf(ios::fixed);
        cout.precision(3);
        cout << ans.first << " " << ans.second << endl;
    }
    
    return 0;
}

C++: #include <cstdio>

using namespace std;

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

int main()
{
  double a[3], b[3];
  while (scanf(" %lf %lf %lf %lf %lf %lf ", &a[0],&a[1],&a[2],&b[0],&b[1],&b[2]) == 6) {
    printf("%.3lf %.3lf\n", cross(a[2], a[1], b[2], b[1]) / cross(a[0], a[1], b[0], b[1]), cross(a[0], a[2], b[0], b[2]) / cross(a[0], a[1], b[0], b[1]));
  }
  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 = (a*f - c*d)/(a*e - d*b);
    y = (c -b*y)/a;

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

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
using namespace std;
int main() {
	long double a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		c *= (d / a);
		b *= (d / a);
		a *= (d / a);
		long double ansx=0, ansy=0;
		if (f - c != 0) {
			ansy = (f - c) / (e - b);
		}
		if (a != 0) {
			ansx = (c - ansy*b) / a;
		}
		ansx *= 1000;
		ansx = round(ansx);
		ansx /= 1000;
		ansy *= 1000;
		ansy = round(ansy);
		ansy /= 1000;
		if (ansx == 0) ansx = 0;
		if (ansy == 0) ansy = 0;
		printf("%.3LF %.3LF\n", ansx, ansy);
	}
}

C++: #include <iostream>
using namespace std;
int main( void )
{
	while ( !cin.eof() )
	{
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if ( cin.eof() )
			break;

		double delta = 1.0 / ( a*e - b*d );

		double x = (double)( e * c - b * f ) * delta;
		double y = (double)( a * f - d * c ) * delta;

		cout.setf( ios::showpoint );
		cout.precision( 4 );
		cout << x << " " << y << endl;

	}
}

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




double gcd( double m, double n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}

double lcm( double m, double n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}


int main(){
    
	double ax, by, c, dx, ey, f;
    double x, y;
    double l, d1, d2;
        
	while(cin>> ax>> by>> c >> dx>> ey>> f){
        
        x = 0.0;
        y = 0.0;
        
        if(ax == dx){
            by -= ey;
            y = (c-f) / by;
            x = (f + ey*(-y)) / dx;
        }
        else if (by == ey) {
            ax -= dx;
            x = (c-f) / ax;
            y = (f + dx*(-x)) / ey;
        }
        else{
            l = lcm(fabs(ax), fabs(dx));
            d1 = l / ax;
            d2 = l / dx;
            ax *= d1;
            by *= d1;
            c  *= d1;
            dx *= d2;
            ey *= d2;
            f  *= d2;
            
            by -= ey;
            y = (c-f) / by;
            x = (f + ey*(-y)) / dx;
        }
        
        printf("%.3lf %.3lf\n", x, y);
        
        
	}
    
    
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
    double a,b,c,d,e,f,x,y;
    while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){
		
        y=(c*d-f*a)/(b*d-a*e);
		x=(c-b*y)/a;
		
		printf("%0.3lf %0.3lf\n",x,y);
	}
	return 0;
}

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

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 == (c - a*x) / b;

	cout >> fixed >> setprecision(3) >> x >> " " >> y >> endl;
	//printf("%.3f %.3f\n", x, y);
}