Go: package main

import "fmt"

func main() {
	var Xs, Ys []float32
	Xs = make([]float32, 0)
	Ys = make([]float32, 0)
	var cnt int
	for {
		var a, b, c, d, e, f, x, y float32
		fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if a == 0 {
			break
		}
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		Xs = append(Xs, x)
		Ys = append(Ys, y)
		cnt++
	}
	for i := 0; i < cnt; i++ {
		fmt.Printf("%.3f %.3f\n", Xs[i], Ys[i])
	}
}

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

using namespace std;

typedef struct Shiki{
  double a,b,c;//ax+by=c
  double x,y;
};

Shiki Equation (Shiki, Shiki);

main(){
  Shiki shiki1,shiki2;
  vector<Shiki> ans;
  int i=0;
  
  while(cin){

    cin>>shiki1.a>>shiki1.b>>shiki1.c>>shiki2.a>>shiki2.b>>shiki2.c;
    ans.push_back(Equation(shiki1,shiki2));
    i++;
    
  }
  cout<<"hogee"<<endl;
  for(int j=0;j<i;j++){
    cout<< fixed << setprecision(4) << ans[j].x << " " << ans[j].y << endl; 
  }
}

Shiki Equation (Shiki A, Shiki B){
  Shiki ans,preA;
  int x,y,aa,ba;
  
  preA = A;

  aa = A.a;
  ba = B.a;
  
  A.a *= ba;
  A.b *= ba;
  A.c *= ba;
  
  B.a *= aa;
  B.b *= aa;
  B.c *= aa;
  
  ans.a = 0;
  ans.b = A.b - B.b;
  ans.c = A.c - B.c;
  ans.y = ans.c / ans.b;
  ans.x = (preA.c - preA.b*ans.y)/preA.a;
  
  if((ans.y*1000)%10 >= 5)ans.y += 0.0001;
  if((ans.y*1000)%10 >= 5)ans.x += 0.0001;
  
  return ans;
}

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

int main(int argc, char const *argv[]){
	
	double a,b,c,d,e,f;
	std::vector<double> solution_x;
	std::vector<double> solution_y;

	while(std::cin >> a >> b >> c >> d >> e >> f){
		double x = (c*e-b*f)/(a*e-b*d);
		double y = (a*f-c*d)/(a*e-b*d);
		solution_x.push_back(x);
		solution_y.push_back(y);
	}

	for (int i = 0; i < solution_x.size(); ++i){
		std::cout << std::fixed;
		std::cout << std::setprecision(3);
		std::cout << solution_x[i] << " " << solution_y[i] << std::endl;
	}

	return 0;
}

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

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

C++: #include<iostream>
using namespace std;
 
int main()
{
    double a,b,c,d,e,f;
    while(cin>>a>>b>>c>>d>>e>>f){
        printf("%.3f ",(c-b*(f-d*c/a)/(e-d*b/a))/a);
        printf("%.3f\n",(f-d*c/a)/(e-d*b/a));
    }
    return 0;
}

C++: #include<stdio.h>
int main(){
    double a,b,c,d,e,f,bb,cc,ee,ff,x,y;
    for(;;){
        if(scanf("%lf",&a)==EOF){break;}
        scanf("%lf",&b);
        scanf("%lf",&c);
        scanf("%lf",&d);
        scanf("%lf",&e);
        scanf("%lf",&f);
        bb=b*d;
        cc=c*d;
        ee=e*a;
        ff=f*a;
        y=(cc-ff)/(bb-ee);
        x=(c-b*y)/a;
        printf("%.3lf %.3lf\n",x,y);
    }
    return 0;
}

C++: #include<cstdio>
int main(){
	int a[2][2],b[2];
	float a_inverse[2][2];
	float answer[2];
	while(scanf("%d %d %d %d %d %d",&a[0][0],&a[0][1],&b[0],&a[1][0],&a[1][1],&b[1]) != EOF){
		float delta = a[0][0] * a[1][1] - a[1][0] * a[0][1];
		a_inverse[0][0] = a[1][1] / delta;
		a_inverse[1][1] = a[0][0] / delta;
		a_inverse[0][1] = -a[0][1] / delta;
		a_inverse[1][0] = -a[1][0] / delta;
		answer[0] = a_inverse[0][0] * b[0] + a_inverse[0][1] * b[1];
		answer[1] = a_inverse[1][0] * b[0] + a_inverse[1][1] * b[1];
		printf("%.3f %.3f\n",answer[0],answer[1]);
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
	//Cramer's Rule
	double a, b, c, d, e, f;

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

C++: #include <iostream>
#include <stdio.h>
define swap(a,b) {a=a+b; b=a-b; a=a-b;}

using namespace std;

void q4() {
	double a, b, c, d, e, f;
	for (; cin >> a >> b >> c >> d >> e >> f;) {
		//cin >> a >> b >> c >> d >> e >> f;
		//scanf_s("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f);

		if (a == 0) {
			swap(a, d);
			swap(b, e);
			swap(c, f);
		}
		b /= a;
		c /= a;
		a = 1;

		e -= b * d;
		f -= c * d;
		d = 0;

		f = f / e;
		e = 1;
		
		c -= f * b;
		b = 0;

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

int main() {
	q4();
	return 0;
}

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

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

int main(){
	double a,b,c,d,e,f,x,y;
	while(cin >> a >> b >> c >> d >> e >> f){
		if(!b){
			x=c/a;
			y=(f-d*x)/e;
		}else if(!e){
			x=f/d;
			x=(f-b*y)/a;
		}else if(!a){
			y=c/b;
			x=(f-e*y)/d;
		}
		else if(!d){
			y=f/e;
			x=(c-b*y)/a;
		}else{
			b/=a;c/=a;a/=a;
			e/=d;f/=d;d/=d;
			double high,low;
			high=1000.0;low=-1000.0;
			while(f+(b-e)*y!=c){
				y=(high+low)/2.0;
				if(f+(b-e)*y<c){
					if(b-e>=0)low = y;
					else high = y;
				}else if(f+(b-e)*y>c){
					if(b-e>=0)high = y;
					else low = y;
				}else{
					break;
				}
			}
			x = c-b*y;
		}
		printf("%.3lf %.3lf\n",x,y);
	}
}

C++: #include <stdio.h>

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

//y = (af-cd)/(ae-bd)
//x = (c-by)/a

int main(void){
double a,b,c,d,e,f;
while(~scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f))
{
printf("%.3f %.3f", (c-b*((a*f-c*d)/(a*e-b*d))), ((a*f-c*d)/(a*e-b*d)));
}
return 0;
}

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

int main(){
	double a[6];
	double x,y;
	cout.precision(3);
	while(true){
		cin >> a[0];
		cin >> a[1];
		cin >> a[2];
		cin >> a[3];
		cin >> a[4];
		cin >> a[5];
		if(cin.eof())
			break;
			
		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 <iostream>
#include <cstdio>

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

C++: #include<iostream>

double a, b, c, d, e, f;
bool flag;

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

C++: #include<stdio.h>

int main(){
	double x1,y1,z1,x2,y2,z2,num1=0,x=0,y=0,z=0,sum1=0,sum2=0,vx=0,vy=0,vz=0;
	
	while(scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&z1,&x2,&y2,&z2)!=EOF){
	
	
	
	
	
	if((x1>0&&x2>0)||(x1<0&&x2>0)){
		num1=x2/x1*-1;
	}
	else if((x1>0&&x2<0)||(x1<0&&x2<0)){
		num1=x2/x1;
	}
	
	
	
	vx=x1*num1;
	vy=y1*num1;
	vz=z1*num1;
	
	x=vx+x2;
	y=vy+y2;
	z=vz+z2;
		
	sum2=z/y;
	sum1=(z2-y2*sum2)/x2;
	
	
	
	
	if(sum1>=0){
	sum1=(int)(sum1*1000+0.5);
	sum1=(double)(sum1/1000);
	}
		else if(sum1<0){
	sum1=(int)(sum1*1000-0.5);
	sum1=(double)(sum1/1000);
	}
	if(sum2>=0){
	sum2=(int)(sum2*1000+0.5);
	sum2=(double)(sum2/1000);
	}
		else if(sum2<0){
	sum2=(int)(sum2*1000-0.5);
	sum2=(double)(sum2/1000);
	}
	
	
	
	printf("%.3f %.3f\n",sum1,sum2);
	
	}
		
	return 0;
}