Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var strs []string
	var a, b, c, d, e, f float64
	var x, y float64
	for scanner.Scan() {
		strs = strings.Split(scanner.Text(), " ")
		_a, _ := strconv.Atoi(strs[0])
		_b, _ := strconv.Atoi(strs[1])
		_c, _ := strconv.Atoi(strs[2])
		_d, _ := strconv.Atoi(strs[3])
		_e, _ := strconv.Atoi(strs[4])
		_f, _ := strconv.Atoi(strs[5])
		a = float64(_a)
		b = float64(_b)
		c = float64(_c)
		d = float64(_d)
		e = float64(_e)
		f = float64(_f)
		y = (c*d - f*a) / (d*b - a*e)
		x = (c - b*y) / a

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

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;
}

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

int main(){
	double a[6];
	double x,y;
	cout<< setprecision(4) << setiosflags(ios::showpoint);
	while(true){
		if(cin.eof())
			break;
		cin >> a[0];
		cin >> a[1];
		cin >> a[2];
		cin >> a[3];
		cin >> a[4];
		cin >> a[5];

			
		x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		if(x == 0)
			x = 0;
		if(y == 0)
			 y = 0;
			 
		cout << x << " " << y << endl;
	}
	return 0;
}

C++: #include <cstdio>

//input
int a, b, c, d, e, f;

void solve(){
	double x = 1.0 * (c * e - b * f) / (a * e - b * d);
	double y = (c - a * x) / b;
	if(x == -0)x = 0;
	if(y == -0)y = 0;
	printf("%.3lf %.3lf\n", x, y);
}

int main(int argc, char const *argv[]){
//	freopen("in.txt", "r", stdin);

	while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF){
		solve();
	}
	
	return 0;
}

C++: #include<bits/stdc++.h>
using ll = long long;
using namespace std;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(3);
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double x = (e*c-b*f)/(e*a-b*d);
		double y = (d*c-a*f)/(d*b-a*e);

		x = round(x*1000)/1000+10e-5;
		y = round(y*1000)/1000+10e-5;

		cout << x << " " <<  y << endl;
	}

	return 0;
}