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

int main()
{
	int a,b,c,d,e,f;
	double def;
	double x,y;
	while(scanf("%d %d %d %d %d %d",&a, &b, &c, &d, &e, &f) != EOF){
		if((a * e - b * d) != 0){
			def = 1 / (double)(a * e - b * d);
		}else{
			printf("NA\n");
			continue;
		}
		x = def * (double)(e * c - b * f);
		y = def * (double)(a * f - d * c);
		printf("%lf %lf\n",x,y);
	}
	return 0;
}

C++: #include <iostream>

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

    while (std::cin >> a >> b >> c >> d >> e >> f) {
        x = (c*e - b*f)/(a*e - b*d);
        y = (c*d - a*f)/(b*d - a*e);
        std::cout << x << " " << y << std::endl;
    }

    return 0;
}

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

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

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

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

double shisyagonyu(double x){
  if(x>0){
    x += 0.0005;
  }
  if(x<0){
    x -= 0.0005;
  }
  return x;
}

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

  while(std::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);

    /*std::cout << x;
    std::cout << " " << y << std::endl;

    x = shisyagonyu((c*e-b*f)/(a*e-b*d));
    y = shisyagonyu((a*f-c*d)/(a*e-b*d));
*/
    std::cout << std::fixed;
    std::cout << std::setprecision(3) << x;
    std::cout << " " << y << std::endl;

  }
}

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

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

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

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

  return 0;
}

C++: #include <iostream>

int main(int argc, const char * argv[]) {
    double 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  - d*b);
        x = (c-b * y) / a;
        printf("%.3f %.3f\n",x,y);
    }
   
}

C++: #include <stdio.h>
#include <vector>
#include <utility>
#include <algorithm>
#include <iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define ld long double
ld a,b,c,d,e,f,x,y;
ld shish(ld a)
{
a*=1000;
a+=0.5;
a=int(a);
a/=1000;
}
int main(){
  while(cin>>a>>b>>c>>d>>e>>f){
    y=(a*f-c*d)/(ld)(a*e-b*d);
    x=(c*e-f*b)/(ld)(a*e-b*d);
    x=shish(x);
    y=shish(y);
    printf("%.3f "  , x); printf("%.3f"  , y); 
    cout<<endl;
  }
}

C++: #include <iomanip>
#include <utility>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;

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

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(){
double a,b,c,d,e,f,x,y;
while(cin>>a>>b>>c>>d>>e>>f){
y=(c*d-f*a)/(b*d-a*e);
x=(c-b*y)/a;
cout<<showpoint<<setprecision(4)<<x<<" "<<y<<endl;
}
return 0;}

C++: #include <math.h>
#include <iostream>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <string>

#define YES "YES"
#define NO "NO"
#define space ' '

using namespace std;

void func();

int main(void)
{
	
	func();

	return 0;
}

// using matrix	?????????????????´??????
void func()
{
	int a, b, c, d, e, f;
	double x, y;

	while (cin >> a >> b >> c >> d >> e >> f, !cin.eof()){


		cout << fixed << setprecision(3);


		if ((a*e - d*b) == 0)
			x = 0.0, y = 0.0;
		else {
			x = (e*c - b*f) / (a*e - d*b);
			y = (-(d*c) + a*f) / (a*e - d*b);


			if (x == 0)
				x = 0.0;
			if (y == 0)
				y = 0.0;
		}
		cout << x << space << y << endl;


		cout << dec;
	}
}

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

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-d*b);
    y=(c*d-a*f)/(b*d-a*e);
    x=round(x*1000)/1000;
    y=round(y*1000)/1000;
    cout << fixed << setprecision(3) << x << " " << setprecision(3) << y << endl;
  }

  return 0;
}

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

float s(float a) {
	a *= 1000;
	if (a > 0) {
		a += 0.5;
	}
	else {
		a -= 0.5;
	}
	int b = a;
	a = b;
	a /= 1000;
	return a;
}

int main() {
	float a, b, c, d, e, f;
	while (~scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)) {
		float x, y;
		if (a == 0) {
			y = c / b;
			x = (f - e * y) / d;
		}
		else if (d == 0) {
			y = f / e;
			x = (c - b * y) / a;
		}else {
			b *= d;
			c *= d;
			e *= a;
			f *= a;
			y = (c - f) / (b - e);
			x = (c / d - b / d * y) / a;
		}
		printf("%.3f %.3f\n", s(x), s(y));
	}
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long

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

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

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	while (true)
	{
		double a1, b1, c1, a2, b2, c2;
		cin >> a1>> b1 >> c1 >> a2 >> b2 >> c2;
		if (cin.fail())
			break;
		double D = a1 * b2 - a2 * b1;
		double D1 = c1 * b2 - c2 * b1;
		double D2 = a1 * c2 - a2 * c1;
		double x = D1 / D;
		double y = D2 / D;
		if (x == 0) x = 0;
		if (y == 0) y = 0;
		printf("%.3f %.3f\n", x, y);
	}
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
using namespace std;

int main(){
	float a,b,c,d,e,f,x,y,i,n;
	while(cin >> a >> b >> c >> d >> e >> f){
		x=(c*e-b*f)/(a*e-b*d);
		y=(c*d-a*f)/(b*d-a*e);
		if(x==-0) x=0;
		if(y==-0) y=0;
		printf("%.3f %.3f\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 = (double)((e*c-b*f) / (a*e-b*d));
  y = (double)((-(d*c)+a*f) / (a*e-b*d));
  if(x == 0){x = 0;}
  if(y == 0){y = 0;}
  printf("%.3f %.3f\n",x,y);
 }
}