Go: package main

import (
  "fmt"
)

func main() {
  var a,b,c,d,e,f float64
  var x,y float64
  for _, err := fmt.Scan(&a, &b, &c, &d, &e, &f); err == nil;
   _, err = fmt.Scan(&a, &b, &c, &d, &e, &f) {
    y = (a*f-c*d)/(a*e-b*d)
    x = (c-b*y)/a
    fmt.Printf("%.3f %.3f\n", x,y)
  }
}

C++: #include<iostream>

using namespace std;

double round(double source, int precision) {	// 四捨五入
	return floor((fabs(source) * pow(10, (double)precision) + 0.5)) / pow(10, (double)precision) * (source < 0 ? -1 : 1);
}

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

		cout.precision(3);
		cout << fixed << round(x, 3) << " " << round(y, 3) << endl;
		//cout << fixed << x + 1e-10 << " " << y + 1e-10 << endl;
	}

	return 0;
}

C++: #include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<iostream>
#include<climits>
#define sc scanf
#define pf printf
#define si(a) scanf("%d",&a)
#define sd(a) scanf("%lf",&a)
#define sl strlen
#define nl printf("\n")
#define f0(i,a) for(__typeof(a)i=0;i<a;i++)
#define f1(i,a) for(__typeof(a)i=1;i<=a;i++)
#define fa0(i,a) for(__typeof(a)i=a;i>=0;i--)
using namespace std;
int main()
{
    int a, b,c,d,e,f;
    while(sc("%d %d %d %d %d %d", &a,&b,&c,&d,&e,&f)!=EOF)
    {
        double niche= (a*e)-(b*d);
        double x=(c*e)-(f*b);
        double y=(a*f)-(c*d);
        pf("%.3lf %.3lf\n", (x/niche), (y/niche));
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<iomanip>
using namespace std;
main(){
	double x[2][3],n,ans[2],tmp;
	while(cin>>x[0][0]>>x[0][1]>>x[0][2]>>x[1][0]>>x[1][1]>>x[1][2]){
		for(int i=0;i<=1;++i){
				ans[i]=0;
		}
		n=x[0][0]*x[1][1]-x[0][1]*x[1][0];
		for(int i=0;i<=1;++i){
			for(int j=0;j<=1;++j){
				x[i][j]/=n;
			}
		}
		double tmp;
		tmp=x[1][1];
		x[1][1]=x[0][0];
		x[0][0]=tmp;
		x[0][1]*=-1;
		x[1][0]*=-1;

		for(int i=0;i<=1;++i){
			for(int j=0;j<=1;++j){
				ans[i]+=x[i][j]*x[j][2];
			}
		}
		cout<<fixed<<setprecision(3)<<ans[0]<<" "<<ans[1]<<endl;
	}
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <cmath>
#include <cfloat>

#define FOR(i,b,n) for(int i=b;i<n;i++)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define INF 1<<25

using namespace std;

double a,b,c,d,e,f,x,y;
double rmat[2][2];

int main()
{
	while( cin >> a >> b >> c >> d >> e >> f, !cin.eof())
	{
		double delta = 1/(a*e - b*d);

		rmat[0][0] = delta*e;
		rmat[0][1] = -delta*b;
		rmat[1][0] = -delta*d;
		rmat[1][1] = delta*a;


		x = c*rmat[0][0] + f*rmat[0][1];
		y = c*rmat[1][0] + f*rmat[1][1];

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

	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  double a[2][3];
  bool f=0;
  while(cin>>a[0][0]>>a[0][1]>>a[0][2]>>a[1][0]>>a[1][1]>>a[1][2]){
    if(a[0][0]==0)
      for(int i=0;i<3;i++)swap(a[0][i],a[1][i]),f=1;
    for(int i=0;i<2;i++){
      for(int j=i+1;j<3;j++)
	a[i][j]/=a[i][i];
      a[i][i]=1;
      for(int j=0;j<2;j++){
	if(j==i)continue;
	double t=a[j][i];
	for(int k=i;k<3;k++)
	  a[j][k]-=t*a[i][k];
      }
    }
    printf("%f %f\n",a[0][2],a[1][2]);
  }
  return 0;
}

C++: #include<stdio.h>

int main(){

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

	while( scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF ){

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

		printf("%lf %lf\n", x, y);
	}

	return 0;
}

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

/*
 * Wrong Answer
 * 2015-06-26 02:00
 */

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

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

	return 0;
}

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

int main(){
    int 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)) *1.0;
        y = ((a*f) - (c*d))/((a*e) - (b*d)) *1.0;

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

C++: import java.util.Scanner;

public class V0_0004 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNextInt()) {
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            int c = scanner.nextInt();
            int d = scanner.nextInt();
            int e = scanner.nextInt();
            int f = scanner.nextInt();

            Equation equation_1 = new Equation(a, b, c);
            Equation equation_2 = new Equation(d, e, f);

            double[] solution = solve(equation_1, equation_2);

            System.out.printf("%.3f %.3f\n", solution[0], solution[1]);
        }
    }

    static double[] solve(Equation left, Equation right) {
        double determinant = left.a * right.b - right.a * left.b;
        double x = (right.b * left.c - left.b * right.c) / determinant;
        double y = (-right.a * left.c + left.a * right.c) / determinant;

        double[] result = { x, y };
        return result;
    }

}

// ax + by = c
class Equation {

    Equation(int a, int b, int c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    public int a;
    public int b;
    public int c;

}

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

C++: #include<iostream>
#include<algorithm>
#include<complex>
#include<iomanip>
using namespace std;
int main(){
	double a,b,c,d,e,f;
	int t=90000;
	for(int i=t;i;i--){
		for(int j=i;j;j--){
			if(i+j==2)a=0.0;
		}
	}
	while(cin>>a){cin>>b>>c>>d>>e>>f;
		cout<<fixed<<setprecision(9)<<abs((c*e-b*f)/(a*e-b*d))<<" ";
		cout<<fixed<<setprecision(9)<<abs((c*d-a*f)/(b*d-a*e))<<endl;
	}
	return 0;
}

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

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

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

#define ROUND_RANK 4
#define EPS 1e-8
//ax+by=c
//dx+ey=f

//行列式の算出
double Calc_det(const double& p11, const double& p12, const double& p21, const double& p22) {
	return (p11*p22 - p12*p21);
}
//xの解の算出
double Calc_x(const double& det, const double& q1, const double& p22, const double& p12, const double& q2) {
	return ((q1*p22 - p12*q2) / det);
}
//yの解の算出
double Calc_y(const double& det, const double& q2, const double& p11, const double& q1, const double& p21) {
	return ((q2*p11 - p21*q1) / det);
}
//少数点以下第rank位で四捨五入
double Round(const double& value, const int& rank) {
	int root = pow(10, rank);
	return (std::round(value*root) / root);
}

int main() {
	double	a, b, c, d, e, f;//データセット
	double  det;//行列式
	double	x, y;//解
	while (std::cin >> a >> b >> c >> d >> e >> f) {
		det = Calc_det(a, b, d, e);
		det = fabs(det);
		x = Calc_x(det, c, e, b, f);
		y = Calc_y(det, a, f, c, d);
		x = Round(x, ROUND_RANK);
		y = Round(y, ROUND_RANK);
		std::cout << std::fixed;
		std::cout << std::setprecision(3) << x + EPS << " " << y + EPS;
	}	
}