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<stdio.h>

void printFunc(int a,int b,int c,int d,int e,int f);

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

  scanf ("%d %d %d %d %d %d\n",&a,&b,&c,&d,&e,&f);
  printFunc(a,b,c,d,e,f);
  scanf ("%d %d %d %d %d %d\n",&a,&b,&c,&d,&e,&f);
  printFunc(a,b,c,d,e,f);

  return 0;
}

void printFunc(int a,int b,int c,int d,int e,int f){
  if(b == 0 || e == 0){
    ansY = 0;
  }
  else{
    ansY = (float)(b*f - e*c)/(float)(b*d - e*a);
  }

  if(a == 0 || d == 0){
    ansX = 0;
  }
  else{
    ansX = (float)(c*e - f*b)/(float)(a*e - d*b);
  }

  printf("%.3f %.3f\n",ansX,ansY);
}

C++: #include <cstdio>

using namespace std;

int main()
{
  double a, b, c, d, e, f;
  while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != -1){
    double y = 0, x = 0;
    double g = e * a;
    double h = f * a;
    double i = b * d;
    double j = c * d;
    double k = i - g;
    double l = j - h;
    y = l / k;
    x = (c - b*y) / a;

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

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

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

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

double calc_Det(double, double, double, double);
 
int main() {
    double a, b, c, d, e, f;
    double x, y;
 
    while (cin >> a >> b >> c >> d >> e >> f) {
        x = (double)calc_Det(c, b, f, e) / calc_Det(a, b, d, e);
        y = (double)calc_Det(a, c, d, f) / calc_Det(a, b, d, e);

        if (fabs(x) < 1e-3) { x = 0.0; }
        if (fabs(y) < 1e-3) { y = 0.0; }
        printf("%.3f %.3f\n", x, y);
    }
}
 
double calc_Det(double a, double b, double c, double d) {
    return a*d - b*c;
}

C++: /* All men have limits. They learn what they are and learn
   not to exceed them, I ignore mine. -Batman           */
#include <bits/stdc++.h>
//#include <iostream>
//#include <vector>
//#include <Windows.h>
using namespace std;

int main(){
int a,b,c,d,e,f;
double x,y;
while(cin>>a>>b>>c>>d>>e>>f){
	x=(double)(c*e-f*b)/(a*e-d*b);
	y=(double)(c*d-f*a)/(b*d-e*a);
	if(x>-0.001&&y>-0.001)printf("%.3lf %.3lf\n",abs(x),abs(y));
	else if(x>-0.001)printf("%.3lf %.3lf\n",abs(x),y);
	else if(y>-0.001)printf("%.3lf %.3lf\n",x,abs(y));
	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){

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

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

C++: #pragma GCC optimize "O3"
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define REP_FROM(i,m,n) for (int i = (m); (i) < int(n); ++(i))
#define REP_REV(i,n) for (int i = (n)-1; (i) >= 0; --(i))
#define REP_FROMREV(i,m,n) for (int i = (n)-1; (i) >= int(m); --(i))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#ifndef LOCAL
#define cerr if (false) cerr
#endif
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

template <class T> inline void setmax(T & a, T const & b) { a = max(a, b); }
template <class T> inline void setmin(T & a, T const & b) { a = min(a, b); }
template <class T> T sq(T x) { return x * x; }
template <class T> T clamp(T a, T l, T r) { return min(max(a, l), r); } // [l, r]
const double EPS = 1e-10;
const double PI  = acos(-1.0);

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

int main(int argc, char *argv[]) {
	// Something to do
	int a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f) {
		solve(a,b,c,d,e,f);
	}
	return 0;
}

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

using namespace std;


int main(){
	int a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double det = a*e - b * d;
		double x = 1 / det * (c * e - b * f);
		double y = 1 / det * (f * a - c * d);
		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;

  while(1){
    cin >> a >> b >> c >> d >> e >> f;
    if(cin.eof())break;

    double x = (f*b-c*e)/(b*d-a*e);
    double y = (c - a*x)/b;
    printf("%.3f %.3f\n",x,y);
  }
}

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

using namespace std;

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

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

int main(int argc, char const *argv[]) {
  double x, y;
  double a, b, c, d, e, f;
  while (!(cin >> a >> b >> c >> e >> f >> d).eof()) {
    x = (f * c - b * d) / (a * f - b * e);
    y = (a * d - c * e) / (a * f - b * e);
    std::cout << fixed << setprecision(3) << x << " " << y << '\n';
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <utility>
using namespace std;
typedef pair<double, double> PDD;
PDD calc(double mat[2][2], double vec[2]){
  double a = mat[0][0], b = mat[0][1], d = mat[1][0], e = mat[1][1];
  double c = vec[0], f = vec[1];
  double det = a * e - d * b;
  return make_pair((e * c - b * f) / det, (-c * d + a * f) / det);
}
int main(){
  double mat[2][2];
  double vec[2];
  while(cin >> mat[0][0] >> mat[0][1] >> vec[0] >> mat[1][0] >> mat[1][1] >> vec[1]){
    PDD res = calc(mat, vec);
    double x = (double)(round(res.first*1000))/1000.0, y = (double)(round(res.second*1000))/1000.0;
    printf("%.3f %.3f\n", x, y);
    x = (x == -0.0) ? 0.0 : x;
    y = (y == -0.0) ? 0.0 : y;
    printf("%.3f %.3f\n", x, y);
  }
  return 0;
}