Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextFloat64() (float64, error) {
	return strconv.ParseFloat(nextString(), 64)
}

func mathRound(f float64) float64 {
	return math.Floor(f + .5)
}

func round(x float64) float64 {
	if math.Abs(x) < 0.001 {
		return 0
	}
	return mathRound(x*1000) / 1000
}

func main() {
	scanner.Split(bufio.ScanWords)
	for {
		a, err := nextFloat64()
		if err != nil {
			break
		}
		b, _ := nextFloat64()
		c, _ := nextFloat64()
		d, _ := nextFloat64()
		e, _ := nextFloat64()
		f, _ := nextFloat64()

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

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

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

int main()
{
  double a[10],b[10];
  for(int i=0;i<6;i++)
  {

	  cin>>a[i];
	  if((a[i]>1000)||(a[i]<-1000)){
	    cout << "nomber error" <<endl;
	    return 0;
     }
  }
  for(int i=0;i<6;i++)
  {

	  cin>>b[i];
	  if((b[i]>1000)||(b[i]<-1000)){
	    cout << "nomber error" <<endl;
	    return 0;
     }
  }
  cout<<fixed<<setprecision(3)<<(a[2]*a[4]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3])<<" ";
  cout<<fixed<<setprecision(3)<<(a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4]);
  cout<<endl;
  cout<<fixed<<setprecision(3)<<(b[2]*b[4]-b[1]*b[5])/(b[0]*b[4]-b[1]*b[3])<<" ";
  cout<<fixed<<setprecision(3)<<(b[2]*b[3]-b[0]*b[5])/(b[1]*b[3]-b[0]*b[4]);
  return 0;
}

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

using namespace std;
double round(double value);

int main(){
  double a,b,c,d,e,f;
  vector<double> al,bl,cl,dl,el,fl;
  double x,y,n,m;

  while(cin >> a >> b >> c >> d >> e >> f){
    al.push_back(a);
    bl.push_back(b);
    cl.push_back(c);
    dl.push_back(d);
    el.push_back(e);
    fl.push_back(f);
  }

  for(int i=0; i<al.size(); i++){
    n = bl[i]/el[i];
    m = al[i]/dl[i];
    x = (cl[i]-n*fl[i])/(al[i]-n*dl[i]); 
    y = (cl[i]-m*fl[i])/(bl[i]-m*el[i]);
    printf("%0.3lf %0.3lf\n", x,y);
  }

  return 0;
}


double round(double value){
  return floor(value*1000 + 0.5)/1000;
}

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

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

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

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

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

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

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


double a,b,c,d,e,f;
double x,y;//x,y座標
int main(){
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) !=EOF){
    

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

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

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

int main() {
	//ax + by = c
	//dx + ey = f

	int A, B, C, D, E ,F = 0;
	cin >> A >> B >> C >> D >> E >> F;

	int COMMON_A = D;
	int COMMON_B = A;
	
	A *= COMMON_A;
	B *= COMMON_A;
	C *= COMMON_A;
	D *= COMMON_B;
	E *= COMMON_B;
	F *= COMMON_B;

	int X,Y;
	Y = (E-B);
	if((F-C) == 0 && (E-B) < 0)
		Y = -Y;
	float y = (F-C) / (E-B);

	X = (C-B*y);

	float x;
	x = (C- B * y) / A;
	if (X == 0 && A < 0)
		x = -x;

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

	return 0;
}

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

int main(){
	double a,b,c,d,e,f;
	double x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		b=d*b-a*e;
		c=d*c-a*f;
		y=(double)c/b;
		x=(f-e*y)/d;
		cout<<setprecision(3)<<setiosflags(ios::fixed)<<x<<" "<<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){
    x = (c * e - b * f) / (a * e - b * d);
    y = (a * f - c * d) / (a * e - b * d);
    x = ((c * e - b * f) == 0 && (a * e - b * d) < 0) ? -x : x;
    y = ((a * f - c * d) == 0 && (a * e - b * d) < 0) ? -y : y;      
    cout << fixed << setprecision(3) << x << ' ' << y << endl;
  }
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
const double EPS = 1e-9;

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

C++: #include <bits/stdc++.h>
using namespace std;

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

	while (cin >> a >> b >> c >> d >> e >> f){
		double x, y;
		x = (c * e - b * f) / (a * e - b * d);
		y = (c - (a * x)) / b;
		
		if (x == -0.000) x = 0.000;
		if (y == -0.000) y = 0.000;

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

	return (0);
}

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

C++: #include <math.h>
#include <algorithm>
#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)
	{
		-1000 <= a, b, c, d, e, f <= 1000;
		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;}
                round(x);
                round(y);
		cout<<setprecision(3);
                cout << setiosflags(ios::fixed);
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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

int main(){

	double a,b,c,d,e,f;
	double x,y;
	register double alpha;

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

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

		if(x == -0.00)x=0.0;
		if(y == -0.00)y=0.0;

		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;

	}

	return 0;

}

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

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

C++: #include<stdio.h>

int main(void)
{
	int a,b,c,d,e,f,t=0,n;
	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++)
	{
		printf("%.3f %.3f\n",x[n],y[n]);
	}
}

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)!=EOF) printf("%.3f %.3f\n",(c*e-b*f)/(a*e-b*d),(a*f-c*d)/(a*e-b*d));
	return 0;
}