Go: package main

import "fmt"

func main() {

	for {
		var a, b, c, d, e, f float64
		var x, y float64
		i, _ := fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if i != 6 {
			return
		}

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

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

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)
		{
			cout << 0 << space << 0 << endl;
		}
		else
		{
			x = (e*c - b*f) / (a*e - d*b);
			y = (-d*c + a*f) / (a*e - d*b);

			
//			cout << x << space << y << endl;
			printf("%3f %3f\n", x, y);
		}
		cout << dec;
	}
}

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

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



int main()
{
	double x1,x2,y1,c1,y2,c2,y,x;
	while((scanf("%lf %lf %lf %lf %lf %lf",&x1,&x2,&y1,&y2,&c1,&c2))!=EOF)
	{
		x=((c1*y1-x2*c2)/(x1*c1-x2*y2));
		y=((-(y2*y1)+x1*c2)/(x1*c1-x2*y2));
		if(x==0)
		{
			x=0;
		}
		if(y==0)
		{
			y=0;
		}
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0; 
}

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

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

C++: #include<stdio.h>
int main(void){
  float a,b,c,d,e,f,x,y,i;
  while(scanf("%d %d %d %d %d %d",&a, &b,&c,&d,&e,&f)!=EOF){
    x=(e*c-b*f)/(d*e-b*d);
    y=(a*f-c*d)/(d*e-b*d);
    printf(" %f %f\n",x,y);}1




  return 0;
}

C++: #include<stdio.h>

int main(void)
{
	int a,b,c,d,e,f,t=0,n,cx,cy;
	double x[100]={0},y[100]={0};
	
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF)
	{
		x[t]=(c*e-b*f)/(a*e-b*d);
		y[t]=(d*c-a*f)/(b*d-a*e);
		t++;
	}

	for(n=0;n<t;n++)
	{
		if(x[n]==-0.000)
		{
			x[n]=0.000;
		}
		if(y[n]==-0.000)
		{
			y[n]=0.000;
		}

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

C++: #include <stdio.h>

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

  while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF) {
    x=(double)(c*e-b*f)/(double)(a*e-b*d);
    y=(double)(a*f-c*d)/(double)(a*e-b*d);
    printf("%.3f %.3f\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){
        if(b*d - a*e != 0){
         
         double tmp1 = (c*e - b*f),tmp2 = (a*e - b*d),tmp3 = (c*d - a*f),tmp4=(b*d - a*e);
        tmp1 = tmp1/tmp2;
        tmp2 = tmp3/tmp4;
        x = tmp1;
        y = tmp2;
	if(x == 0) x = 0;
	if(y == 0) y = 0;
         printf("%.3f %.3f",x,y);
        }
    }
    return 0;
}

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

using namespace std;


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

	while(scanf("%lld %lld %lld %lld %lld %lld",&a,&b,&c,&d,&e,&f)!=EOF){
		if(c*e==b*f){
			x=0;
		}else{
			pre_x=(10000*(c*e-b*f))/(a*e-d*b);

			if(pre_x>0 && ((pre_x%10) >= 5)){
				pre_x += (10-(pre_x%10));
			}else if(pre_x < 0 && ((pre_x%10) <= -5)){
				pre_x -= (10+(pre_x%10));
			}
			x = pre_x/10000;
		}

		if(a*f==c*d){
			y=0;
		}else{
			pre_y=(10000*(a*f-c*d))/(a*e-b*d);
			if(pre_y>0 && ((pre_y%10) >= 5)){
				pre_y += (10-(pre_y%10));
			}else if(pre_y < 0 && ((pre_y%10) <= -5)){
				pre_y -= (10+(pre_y%10));
			}
			y = pre_y/10000;
		}

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

    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;
float a,b,c,d,e,f;
float findoutx,findouty;
float x,y,yadd;
float Timers1,Timers2;
int main()
{
    while((cin >> a >> b >> c >> d >> e >> f)!=EOF)
    {
    Timers1 = a;
    Timers2 = d;
    a=a*Timers2;
    b=b*Timers2;
    c=c*Timers2;
    d=d*Timers1;
    e=e*Timers1;
    f=f*Timers1;

    findouty=b-e;
    yadd = c-f;
    findouty = yadd/findouty;
    b = b*findouty;
    findoutx=(c-b)/a;

    if(findoutx==0)findoutx=0;
    if(findouty==0)findouty=0;



    cout<<fixed<<setprecision(3)<<findoutx << " "<<findouty<<endl;
    }

return 0;
}

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

int a, b, c, d, e, f;
double x, y;

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

	return 0;
}

C++: #include <stdio.h>

int main(){
	int a,b,c,d,e,f;
	double x,y;
	while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF){
		x = ((double)e*(double)c-(double)b*(double)f)/((double)e*(double)a-(double)b*d);
		y = ((double)d*(double)c-(double)a*(double)f)/((double)b*(double)d-(double)a*e);
		if((int)(x*10000)/10000 >= 5) x+= 0.001;
		if((int)(y*10000)/10000 >= 5) y+= 0.001;
		printf("%.3f %.3f\n", x, y);
	}
}

C++: #include<stdio.h>

int a ;
int b ;
int c ;
int d ;
int e ;
int f ;
double x ;
double y ;

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

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

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

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


double a,b,c,d,e,f;
double A,B;//x,y座標
int main(){
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) !=EOF){
    B =(c*e-f*b)/(a*e-b*d);
    A = (c -b*B)/a;
    
    if(A ==0)
      A =0;
    if(B ==0)
      B =0;
    if(A > 0){
    A =floor((A+0.0005)*1000)/1000;
    }else if(A < 0){
    A =floor((A-0.0005)*1000)/1000;

    }
    if(B > 0){//小数第4位を四捨五入
    B =floor((B+0.0005)*1000)/1000;
    }else if(B <0){
    B =floor((B-0.0005)*1000)/1000;
    }
    printf("%.3f %.3f\n",B,A);
  }
  return 0;
}

C++: #include <stdio.h>
#include <vector>
#include <utility>
#include <algorithm>
#include <iostream>
#include <limits>
#include <iomanip>
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)
{
	if (a == 0) { return a; }
	
	a *= 1000;
	if (a > 0) {
		a += 0.51;
	}
	else {
		a -= 0.51;
	}
	a = (ld)((int)a);
	a /= 1000;
	return a;
}
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);
		cout << fixed << setprecision(10) << x ;
		cout << " ";
		cout << fixed << setprecision(10) << y<< endl;
	}
	return 0;
}

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

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

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

    return 0;
    
    }