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 <iomanip>
#include <stdio.h>
using namespace std;


int main(void){

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

  float x;
  float y;

  cin >> a >> b >> c >> d >> e >> f;

  x = a * e - b * d ;
  y = b * d - a * e ;

  if ((x == 0) && (y == 0)){
    cerr << "error" << endl;
    exit(1);
  }else if(x == 0){
    cerr << "error" << endl;
    exit(1);
  }else if(y == 0){
    cerr << "error" << endl;
    exit(1);
  }else{

    if(c * e - b * f == 0){
      x = 0;
    }else{
      x = ( c * e - b * f ) / x ;
    }

    if(c * d - a * f == 0){
      y = 0;
    }else{
      y = ( c * d - a * f) / y;
    }

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

  return 0;


}

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

C++: #include<iostream>
#include<stdlib.h>
#include<stdio.h>

#define A 0
#define B 1
#define C 3
#define D 4
#define AX 2
#define AY 5
#define X 6
#define Y 7

main(){
  using namespace std;
  float data[1000][8],dt,temp[8];
  int size;
  for(size = 0;size<1000;size++){
    if(!(cin>>data[size][0]))break;
    for(int i=1;i<6;i++)cin>>data[size][i];
    dt = (data[size][A]*data[size][D])-(data[size][B]*data[size][C]);
    for(int i=0;i<6;i++){
      temp[i]=data[size][i];
    }
    data[size][A]=temp[D]/dt;
    data[size][B]=(-1)*temp[B]/dt;
    data[size][C]=(-1)*temp[C]/dt;
    data[size][D]=temp[A]/dt;
    data[size][X]=(data[size][A]*data[size][AX])+(data[size][B]*data[size][AY]);
    data[size][Y]=(data[size][C]*data[size][AX])+(data[size][D]*data[size][AY]);
  }
  for(int i=0;i<size;i++){
    printf("%.3f %.3f\n",data[i][6],data[i][7]);
  }
  
}

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

int main() {
  int a, b, c, d, e, f;
  std::cout.precision(3);
  std::cout << std::fixed;
  while (!std::cin.eof()) {
    std::cin >> a >> b >> e >> c >> d >> f;

    double factor = a * d - b * c;
    double x = ( d * e + -b * f) / factor;
    double y = (-c * e +  a * f) / factor;
    if (x == 0.0) { x = 0.0; }
    if (y == 0.0) { y = 0.0; }
    std::cout << x << ' ' << y << std::endl;

    while (isspace(std::cin.peek())) { std::cin.ignore(); }
  }
}

C++: #include<iostream>
#include<string>
#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-(b*f/e))/(a-(b*d/e));
		y=(c-a*x)/b;
		cout<<fixed<<setprecision(5)<<x<<endl;
		cout<<fixed<<setprecision(5)<<y<<endl;
	}
	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("%.3f %.3f\n", x, y);        
        //printf("y=%f\n", (f-(c*d/a))/(e-(b*d/a)));
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    double a,b,c,d,e,f,x,y,z;

    while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF)
          {
              z=(a*e)-(b*d);
                x=((c*e)-(b*f))/z;
                y=((a*f)-(d*c))/z;

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

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

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

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

    return 0;
    
    }

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

void solve_SE(double* x, double a, double b, double c, double d, double e, double f)
{
    x[0] = (c * e - f * b) / (a * e - d * b);
    x[1] = (c * d - f * a) / (b * d - e * a);
}

int main()
{
    double a, b, c, d, e, f;
    double x[2];
    while (cin >> a >> b >> c >> d >> e >> f) {
        solve_SE(&x[0], a, b, c, d, e, f);
        for (int i = 0; i < 2; i++) {
            x[i] *= 1000;
            if (x[i] > 0)
                x[i] += 0.5;
            else 
                x[i] -= 0.5;
            x[i] = static_cast<int>(x[i]) / 1000;
        }
        cout << fixed << setprecision(3) << x[0] << ' ' << x[1] << endl;
    }
}

C++: ///BISMILLAHIR RAHMANIR RAHMIM
#include <bits/stdc++.h>
using namespace std;

int main ()
{
    ///freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    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=(c*e-b*f)/(a*e-b*d);
        y=(a*f-c*d)/(a*e-b*d);
        if (x==0.000 && y!=0.000)
            printf("0.000 %.3lf\n",y);
        else if(x!=0.000 && y==0.000)
            printf("%.3lf %0.000\n",x);
        else
            printf("%.3lf %.3lf\n",x,y);
    return 0;
}
}

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){
	
		if (a==0){
			y = c / b;
			x = (f - (e*c/b)) / d;
		}else if(b==0){
			x = c / a;
			y = (f - (d*c/a)) / e;
		}else if(d==0){
			y = f / e;
			x = (c - (b*f/e)) / a;
		}else if(e==0){
			x = f / d;
			y = (c - (a*f/d)) / b;
		}else{
			x = (f - (e*c/b)) / (d - (e*a/b));
			y = (f - (d*c/a)) / (e - (d*b/a));
		}
		if (x==-0) x=0;
		if (y==-0) y=0;
		printf("%.3f %.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<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    int a,b,c,d,e,f;
    while(cin>>a>>b>>c>>d>>e>>f){
        double x,y;
        x=(c-b*(a*f-c*d)/(a*e-b*d))/a;
        y=(a*f-c*d)/(a*e-b*d);
        printf("%.3f %.3f\n",x,y);
    }
}