Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	for {
		data := nextInts(6)
		if data[0] == 0 || data[1] == 0 || data[2] == 0 || data[3] == 0 || data[4] == 0 || data[5] == 0 {
			break
		}
		fmt.Printf("%.3f\n", Round(GetX(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
		fmt.Printf("%.3f\n", Round(GetY(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
	}
}

func GetX(a, b, c, d, e, f float64) float64 {
	return ((c * e) - (b * f)) / ((a * e) - (b * d))
}

func GetY(a, b, c, d, e, f float64) float64 {
	return ((c * d) - (a * f)) / ((b * d) - (a * e))
}

func Round(f float64, places int) float64 {
	shift := math.Pow(10, float64(places))
	return math.Floor(f*shift+.5) / shift
}

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

func nextInt() float64 {
	a, _ := strconv.Atoi(next())
	return float64(a)
}

func nextInts(n int) []float64 {
	a := make([]float64, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
	return a
}

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

//ax+by=c
//dx+ey=f

//行列式の算出
double Calc_det(const double& p11, const double& p12, const double& p21, const double& p22) {
	return (p11*p22 - p12*p21);
}
//xの解の算出
double Calc_x(const double& det, const double& q1, const double& p22, const double& p12, const double& q2) {
	return ((q1*p22 - p12*q2) / det);
}
//yの解の算出
double Calc_y(const double& det, const double& q2, const double& p11, const double& q1, const double& p21) {
	return ((q2*p11 - p21*q1) / det);
}
//少数点以下第rank位で四捨五入
double Round(const double& value, const int& rank) {
	int root = pow(10, rank);
	return (std::round(value*root) / root);
}

int main() {
	double	a, b, c, d, e, f;//データセット
	double  det;//行列式
	double	x, y;//解
	std::cin >> a >> b >> c >> d >> e >> f;
	det = Calc_det(a, b, d, e);
	x = Calc_x(det, c, e, b, f);
	y = Calc_y(det, a, f, c, d);
	x = Round(x, 4);
	y = Round(y, 4);
	std::cout << std::fixed;
	std::cout << std::setprecision(3) << x << " ";
	std::cout << std::setprecision(3) << y << std::endl;
}

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



int main()
{
	double a[3], b[3];
	while (cin >> a[0] >> a[1] >> a[2] >> b[0] >> b[1] >> b[2])
	{
		if (a[0] == 0)
		{
			double c = a[2] / a[1];
			double d = (b[2] - b[1] * c) / b[1];
			a[2] = d;
			b[2] = d;
		}
		else
		{
			double c = 1;
			if (b[0] != 0)
			{
				c = a[0] / b[0];
				b[1] = b[1] * c - a[1];
				b[2] = b[2] * c - a[2];
			}
			b[2] /= b[1];
			b[1] = 1;
			a[2] -= b[2] * a[1];
			a[2] /= a[0];
		}
		if (a[2] < 0.0001 && a[2] > -0.0001)
			a[2] = 0.000;
		if (b[2] < 0.0001 && b[2] > -0.0001)
			b[2] = 0.000;

		cout << fixed << setprecision(3) << a[2] << b[2] << endl;
	}

	return 0;
}

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

int main()
{
	int a,b,c,d,e,f;
	double x,y;
	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.00){x=0.00;}
		if(y == -0.00){y=0.00;}
		cout<<setprecision(3)<<fixed;
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

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



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


	while (cin >> a >> b >> c >> d >> e >> f){

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

	
	}


	
	
	return 0;
}

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

int main(){
	long double a11=0,a12=0,c=0,a21=0,a22=0,f=0;
	while(cin>>a11>>a12>>c>>a21>>a22>>f){
		double x,y,delta=((double)a11*a22-(double)a12*a21);
		x=((double)a22*c-(double)a12*f)/delta;
		y=((double)a11*f-(double)c*a21)/delta;
		if(x>0){x=(double)(((int)((x*1000)+0.5))/1000);
		}else{x=(double)(((int)((x*1000)-0.5))/1000);}
		if(y>0){y=(double)(((int)((y*1000)+0.5))/1000);
		}else{y=(double)(((int)((y*1000)-0.5))/1000);}
		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
	}
	return 0;
}

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

class data {
public:
	int number[6];
	double substitute_x(int num){
		return (number[2] - number[1] * num) / number[0];
	}
	double quadratic_y() {
		return
			(number[2] * number[3] - number[0] * number[5])
			/ (number[1] * number[3] - number[0] * number[4]);
	}
};

int main() {
	data temp;
	while (cin >> temp.number[0]) {
		for (int i = 1; i < 6; i++) {
			cin >> temp.number[i];
		}
		cout << fixed << setprecision(3) 
			<< temp.substitute_x(temp.quadratic_y()) << flush;
		cout << " " << flush;
		cout << fixed << setprecision(3) 
			<< temp.quadratic_y() << endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(){
	int X,Y;
double a,b,c,d,e,f,x,y;
double p[2][3]={0};
y=0;x=0;
while(1){
scanf("%lf",&a);scanf("%lf",&b);scanf("%lf",&c);
scanf("%lf",&d);scanf("%lf",&e);scanf("%lf",&f);
if(a==EOF&&b==EOF&&c==EOF&&d==EOF&&e==EOF&&f==EOF)break;
y=(d*c-a*f)/(b*d-a*e);
x=(e*c-b*f)/(e*a-b*d);
X=x*10000;
Y=y*10000;
if((X)%10>=5)x+=0.0005;
else if((X)%10<=-5)x-=0.0005;
if((Y)%10>=5)y+=0.0005;
else if((Y)%10<=-5)y-=0.0005;

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

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

 int main() {

	 double a;
	 double b;
	 double c;
	 double d;
	 double e;
	 double f;
	 double x;
	 double 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 << std::fixed;
		 std::cout << std::setprecision(4) << x << " " << std::setprecision(4) << y << std::endl;
	 }



}

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