Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanLines)
	for sc.Scan() {
		s := strings.Split(sc.Text(), " ")
		a, _ := strconv.ParseFloat(s[0], 64)
		b, _ := strconv.ParseFloat(s[1], 64)
		c, _ := strconv.ParseFloat(s[2], 64)
		d, _ := strconv.ParseFloat(s[3], 64)
		e, _ := strconv.ParseFloat(s[4], 64)
		f, _ := strconv.ParseFloat(s[5], 64)
		x := ((b * f) - (c * e)) / ((b * d) - (a * e))
		y := ((a * f) - (c * d)) / ((a * e) - (b * d))
		if x == 0 {
			fmt.Printf("0.000 %.3f\n", y)
		} else if y == 0 {
			fmt.Printf("%.3f 0.000\n", x)
		} else {
			fmt.Printf("%.3f %.3f\n", x, y)
		}
	}
}

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;
static const double EPS = 1e-5;
typedef long long ll;
#define FOR(i,n) for(i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
	double a,b,c,d,e,f,r1,r2;
	for(;scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF;){
		r1=(c*e-f*b)/(a*e-d*b);
		r2=(c*d-f*a)/(b*d-e*a);
		-0.001<r1&&r1<0.001&&(r1=0);
		-0.001<r2&&r2<0.001&&(r2=0);
		printf("%.3f %.3f\n",r1,r2);
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <math.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 = 0.0;
        y = 0.0;
        
        x = (c*e-f*a)/(a*e-b*d);
        
        y = (c*d-f*a)/(b*d-a*e);
        
        
        if (x == 0) {
            x = 0;
        }
        else if (y == 0) {
            y = 0;
        }
        
        printf("%.3f %.3f\n", x, y);
        
        
	}
    
    
	return 0;
}

C++: #include<stdio.h>
struct EQ{
  float x;
  float y;
  float a;
};

float fy(struct EQ,struct EQ);
float fx(struct EQ,struct EQ);


int main(void){

  struct EQ eq1,eq2;
  float x,y;
 while(scanf("%f %f %f %f %f %f",&eq1.x,&eq1.y,&eq1.a,&eq2.x,&eq2.y,&eq2.a)!=EOF){
 
   y=fy(eq1,eq2);
   x=fx(eq1,eq2);
 printf("%0.3f %0.3f\n",x,y); 
 }
  return 0;
  }

float fy(struct EQ eq1,struct EQ eq2){

  float y,a,x;

  if(eq1.x==0 && eq1.a!=0){ 

    if(eq1.y<0){
      eq1.y=-eq1.y;
      eq1.a=-eq1.a;
    }
    y=eq1.a/eq1.y;
  }
 
  else if(eq2.x==0 && eq2.a!=0){ 

    if(eq2.y<0){
      eq2.y=-eq2.y;
      eq2.a=-eq2.a;
    }
    y=eq2.a/eq2.y;
  }
  else if(eq1.x==0 && eq1.a==0){  
    y=0;
  }
  else if(eq2.x==0 && eq2.a==0){
    y=0;
  }

  else{

  eq1.y=eq1.y/eq1.x;
  eq1.a=eq1.a/eq1.x;
 
  eq2.y=eq2.y/eq2.x;
  eq2.a=eq2.a/eq2.x;

   y=eq1.y-eq2.y;
  a=eq1.a-eq2.a;
  if(y<0){
    y=-y;
    a=-a;
  }

   y=a/y;

  if(y==-0){
    y=0;
  }


  }
  return y;

  }

float fx(struct EQ eq1,struct EQ eq2){

  float x,a;

  if(eq1.y==0 && eq1.a!=0){ 
    
    if(eq1.x<0){
      eq1.x=-eq1.x;
      eq1.a=-eq1.a;
    }
    x=eq1.a/eq1.x;
  }
  
  else if(eq2.y==0 && eq2.a!=0){ 
    
    if(eq2.x<0){
      eq2.x=-eq2.x;
      eq2.a=-eq2.a;
    }
    x=eq2.a/eq2.x;
  }
  else if(eq1.y==0 && eq1.a==0){  
    x=0;
  }
  else if(eq2.y==0 && eq2.a==0){
    x=0;
  }

  else{

  eq1.x=eq1.x/eq1.y;
  eq1.a=eq1.a/eq1.y;

  eq2.x=eq2.x/eq2.y;
  eq2.a=eq2.a/eq2.y;

  x=eq1.x-eq2.x;
  a=eq1.a-eq2.a;

  if(x<0){
    x=-x;
    a=-a;
  }
 
  x=a/x;

  if(x==-0){
    x=0;
  }

  }

  return x;

  }

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

int main()
{
	double a,b,c,d,e,f;
	double x,y;
	int count = 0;
	vector<double> result_x,result_y;

	while(cin >> a >> b >> c >> d >> e >> f) {
		y = (a * f - c * d) / (a * e - b * d);
		if(a==0)
			x = (c - b * y) / a;
		else
			x = (f - e*y) / d;
		result_y.push_back(y);
		result_x.push_back(x);
		cout << result_x[count] << ' ' << result_y[count] << endl;
		count++;
	}

	return 0;
}

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

using namespace std;

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

    while (cin >> a >> b >> c >> d >> e >> f) {
        answer1 = static_cast<double>(e * c - b * f) / (a * e - b * d);
        answer2 = static_cast<double>(-d * c + a * f) / (a * e - b * d);
        if (answer1 == 0) answer1 = 0.000;
        if (answer2 == 0) answer2 = 0.000;
        cout << fixed << setprecision(3) << round(answer1) << " " << round(answer2) << endl;
    }
    
    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<string>
#include<vector>
#include<algorithm>
#include <functional>
#include <iomanip>
using namespace std;

#define rep(p,q) for(int i = p; i < q;i++)

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

C++: #include <iostream>
#include <stdlib.h>
#include <string.h>
#include <sstream>
#include <iostream>
#include <math.h>
#include <iomanip>

using namespace std;

string float_to_string(float f, int digits)
{
  if (f == 0) {
    f = 0;
  }
  ostringstream oss;
  oss << setprecision(digits) << setiosflags(ios::fixed) << f;
  return oss.str();
}

void calc_and_output(int *c)
{
  float x = (float)(c[1]*c[5]-c[2]*c[4])/(c[1]*c[3]-c[0]*c[4]);
  float y = (float)(c[0]*c[5]-c[2]*c[3])/(c[0]*c[4]-c[1]*c[3]);

  cout << float_to_string(x, 3) << " " << float_to_string(y, 3) << endl;
}

int main(int argc, char const* argv[])
{
  int c[6];

  string line;
  while (getline(cin, line)) {
    istringstream iss(line);
    int val;
    int c[6];
    for (int i = 0; i < 6; i++) {
      iss >> val;
      c[i] = val;
    };

    calc_and_output(c);
  }

  return 0;
}

C++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004&lang=jp
#include <algorithm>
#include <vector>
#include <iostream>
#include <math.h>
//#include <bits/stdc++.h>	//C++標準ライブラリ一括読み込み
using namespace std;

// ax+by=c
// dx+ey=f
double unko(double x){
	int y=int(round(x*1000));
	return double(y/1000);
}

int main(){
    double a,b,c,d,e,f;
    cin>>a>>b>>c>>d>>e>>f;
//	long long x=(c*e-b*f)/(a*e-b*d)+0.0005;
//	long long y=(c*d-a*f)/(b*d-a*e)+0.0005;
//	printf("%.3f %.3f",x,y);
	double x=(c*e-b*f)/(a*e-b*d);
	double y=(c*d-a*f)/(b*d-a*e);
	printf("%.3f %.3f",unko(x),unko(y));
    return 0;
}

C++: #include <cstdio>
using namespace std;
float a,b,c,d,e,f,t;
int main(){
  for(;~scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f);
    t=a*e-b*d,printf("%.3f %.3f\n",(e*c-b*f)/t+0.,(a*f-d*c)/t+0.)
  );
  return 0;
}