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

void printFunc(int a,int b,int c,int d,int e,int f);

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

  scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
  printFunc(a,b,c,d,e,f);
  scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
  printFunc(a,b,c,d,e,f);

  return 0;
}

void printFunc(int a,int b,int c,int d,int e,int f){
  float ansX,ansY;
  if(b == 0 || e == 0){
    ansY = 0;
  }
  else{
    ansY = (float)(c*d - f*a)/(float)(b*d - e*a);
  }

  if(a == 0 || d == 0){
    ansX = 0;
  }
  else{
    ansX = (float)(c*e - f*b)/(float)(a*e - d*b);
  }

  if(ansX < 0.001f){
    ansX = 0.0f;
  }
  if(ansY < 0.001f){
    ansY = 0.0f;
  }

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

C++: #include <stdio.h>

int main(void){

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

	while ( scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){

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

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

	return 0;
}

C++: #include<stdio.h>
int main(){
	int a,b,c,d,e,f;
	double x,y,z,v;
	scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
	x=(double)(c*e-b*f)/(a*e-b*d);
	y=(double)(c*d-a*f)/(b*d-a*e);
	if(x>=-0.0005&&x<0.0005)	x=0;
	if(y>=-0.0005&&y<0.0005)	y=0;
	printf("%.3lf %.3lf\n",x,y);
}

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

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

C++: #include<bits/stdc++.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=round((c*e-b*f)/(a*e-b*d)*1000)/1000;
    y=round((c*d-a*f)/(b*d-a*e)*1000)/1000;

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

}

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

int main(){

    double a,b,c,d,e,f,y,x,bb,cc,dd,ee,ff;
    while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
        bb=b/a;
        cc=c/a;
        ee=e/d;
        ff=f/d;
        y=(cc-ff)/(bb-ee);
        x=(c-b*y)/a;
        x+=0.0004;
        y+=0.0004;
        printf("%.3lf %.3lf\n",x,y);
    
        /*
        y=round(1000*y);
        y=(int)y;
        y=y/1000+0.0;
        
        x=round(1000*x);
        x=(int)x;
        x=x/1000+0.0;
        cout<<fixed<<setprecision( 3 )<<x<<" "<<y<<endl;*/
        //printf("%f %f\n",x,y);
    }
    return 0;
}

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

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*d - a*f) / (b*d - a*e);

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

C++: #include<stdio.h>
int main(void){
	int a,b,c,d,e,f;
	while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)){
	double y=(c*d-a*f)/(b*d-a*e);
	double x=(a*e-b*d)/(c*e-b*f);
		if(b*d-a*e==0)y=0;
		if(c*e-b*f==0)x=0;
	printf("%.3f %.3f\n",((int) x*10000%10<5)?x:x+0.001,((int)y*10000%10<5)?y:y+0.001);
	}
	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){
    
    if(a*e-b*d != 0){
    B =(c*e-f*b)/(a*e-b*d);
    A =(c -b*B)/a;
    }
    
    if(A > 0){
    A =round((A+0.0005)*1000)/1000;
    }else if(A < 0){
    A =round((A-0.0005)*1000)/1000;
    }
    if(B > 0){//小数第4位を四捨五入
    B =round((B+0.0005)*1000)/1000;
    }else if(B <0){
    B =round((B-0.0005)*1000)/1000;
    }
    printf("%.3f %.3f\n",B,A);
  }
  return 0;
}

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 = (c * e - b * f) / (a * e - b * d);
        double y = (a * f - c * d) / (a * e - b * d);
        x *= 1000; x = x + (x > 0 ? 0.5 : -0.5); x = (int)x;
        y *= 1000; y = y + (y > 0 ? 0.5 : -0.5); y = (int)y;
        printf("%.3f %.3f\n", x / 1000, y / 1000);
    }
    return 0;
}

C++: #include<cstdio>

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

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

C++: #include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <limits>
#include <sstream>
#include <iomanip>

using namespace std;

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

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

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

C++: #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <cassert>
using namespace std;

#define GET_ARG(a,b,c,F,...) F
#define REP3(i,s,e) for (i = s; i <= e; i++)
#define REP2(i,n) REP3 (i,0,(int)(n)-1)
#define REP(...) GET_ARG (__VA_ARGS__,REP3,REP2) (__VA_ARGS__)
#define RREP3(i,s,e) for (i = s; i >= e; i--)
#define RREP2(i,n) RREP3 (i,(int)(n)-1,0)
#define RREP(...) GET_ARG (__VA_ARGS__,RREP3,RREP2) (__VA_ARGS__)
#define DEBUG(x) cerr << #x ": " << x << endl

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

C++: #include <iostream>
using namespace std;
int main () {
	double m[4], e, f, d;
	cout.setf (ios::fixed); cout.precision (3);
	while (cin >> m[0] >> m[1] >> e >> m[2] >> m[3] >> f) {
		d = m[0]*m[3] - m[1]*m[2];
		cout << ((m[3]*e-m[1]*f)/d) << " " << ((m[0]*f-m[2]*e)/d) << endl;
	}
}

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

using namespace std;

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

C++: #include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>

using namespace std;

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