Go: package main

import (
  "fmt"
)

func main() {
  var a,b,c,d,e,f float64
  var x,y float64
  for _, err := fmt.Scan(&a, &b, &c, &d, &e, &f); err == nil;
   _, err = fmt.Scan(&a, &b, &c, &d, &e, &f) {
    y = (a*f-c*d)/(a*e-b*d)
    x = (c-b*y)/a
    fmt.Printf("%.3f %.3f\n", x,y)
  }
}

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 =(f -a*B)/b;
    }
    
    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 <iostream>
#include <cmath>
#include <string>
using namespace std;

int main(){
	float x, y;
	int a, b, c, d, e, f, xx, yy;
	string p, q;
	while (true){
		cin >> a >> b >> c >> d >> e >> f;
		if (cin.eof()){
			break;
		}
		if (a == 0){
			y = c / b;
			x = (f - e * y) / d;
		}
		else if (b == 0){
			x = c / a;
			y = (f - d * x) / e;
		}
		else if(d == 0){
			y = f / e;
			x = (c - b * y) / a;
		}
		else if(e==0){
			x = f / d;
			y = (c - a * x) / b;
		}
		else{
			x = (c*e - b*f) / (e*a - b*d);
			y = (c - a*x) / b;
		}
		xx = x / 1;
		yy = y / 1;
		p = to_string(xx);
		q = to_string(yy);
		p += ".";
		q += ".";
		b = x * 10;
		c = y * 10;
		for (int i = 1;i<4;i++){
			p += to_string((b*10) % 10);
			q += to_string((c*10) % 10);
			x = x * 10;
			y = y * 10;
			b = x;
			c = y;
		}
		cout << p << " " << q << endl;
	}
	return 0;
}

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

using namespace std;

int main() {

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

	cout << fixed << setprecision(3) << ((c*e-b*f)/(a*e-b*d))  << " " << ((a*f-c*d)/(a*e-b*d)) << endl;
	
	}

	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <numeric>
#include <string>
#include <vector>
#include <list>
#include <iterator>

#include <cmath>

#define DIM 2
#define EPS (5*10e-4)

typedef std::vector<double> Vec;
typedef std::vector<Vec> Mat;
typedef std::pair<Mat,Vec> Eq;

void removeMinusZero(double& x){
	if ( fabs(x)< EPS ){
		x = 0.0;
	}
}

int main(void){
	using namespace std;
	cout << fixed << setprecision(3);

	list<Eq> input;
	double a,b,c,d,e,f;

	while(cin >> a >> b >> c >> d >> e >> f){
		Vec m1, m2;
		m1.push_back(a);
		m1.push_back(b);
		m2.push_back(d);
		m2.push_back(e);

		Vec vec;
		vec.push_back(c);
		vec.push_back(f);

		Mat mat;
		mat.push_back(m1);
		mat.push_back(m2);

		Eq eq = make_pair(mat,vec);

		input.push_back(eq);
	}

	for(auto itr = input.begin(); itr!=input.end(); ++itr){
		auto mat = itr->first;
		auto vec = itr->second;

		auto det = mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0];

		mat[0][1] = -mat[0][1];
		mat[1][0] = -mat[1][0];
		swap(mat[0][0],mat[1][1]);

		Vec output(DIM);
		for (int i=0; i<DIM; i++){
			output[i] = inner_product(vec.begin(), vec.end(), mat[i].begin(), 0);
		}
		transform(output.begin(), output.end(),output.begin(), std::bind2nd(divides<double>(),det));
		for_each(output.begin(), output.end(), [](double& x) -> void { if(abs(x)< EPS){ x=0.0; } });
		cout << output[0] << " " << output[1] << endl;
	}
}

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(cin>>a>>b>>c>>d>>e>>f){
        bb=b/a;
        cc=c/a;
        ee=e/d;
        ff=f/d;
        y=(cc-ff)/(bb-ee);
        x=(c-b*y)/a;
        //y=123.45678;
        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>
using namespace std;

int main(){

	float a, b, c, d, e, f;

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

		float det = a * e - b * d;

		float dx = c * e - b * f;
		float dy = a * f - c * d;

		float x = dx / det;
		float y = dy / det;

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

	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <fstream>
#include <stdint.h>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
using namespace std;

constexpr int INF       = 1000000000;/* 1e+9a */
constexpr int MODULO    = 1000000007;

#define REP(i,f,n) for(int i=(f); i < (n); ++i)
#define PER(i,f,n) for(int i=(n-1); i >= f; --i)

signed main()
{
    ios::sync_with_stdio(false);
	int a, b, c, d, e, f;
	while(cin >> a)
	{
		cin >> b >> c >> d >> e >> f;
		double m = a * e - b * d;
		double x = (c * e) /m -( b * f)/m;
		double y = (a * f) /m -( c * d)/m;

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

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

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

int main() {
  int a, b, c, d, e, f;
  std::cout.precision(3);
  std::cout << std::fixed;
  while (!std::cin.eof()) {
    std::cin >> a >> b >> e >> c >> d >> f;

    double factor = a * d - b * c;
    double x = ( d * e + -b * f) / factor;
    double y = (-c * e +  a * f) / factor;
    std::cout << x << ' ' << y << std::endl;

    while (isspace(std::cin.peek())) { std::cin.ignore(); }
  }
}

C++: #include<iostream>
#include<iomanip>
#include<math.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 = ((a*f)-(c*d))/((a*e)-(b*d));
		
		/*x *= 1000;
		y *= 1000;
		
		round(x);
		round(y);
		
		x /= 1000;
		y /= 1000;
		*/
		cout << fixed << setprecision(3) << x << ' ' << y << endl;
	}
	
	return 0;
}

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

int main()
{
    using namespace std;
    typedef struct {
        double x;
        double y;
    } xy;
    double a, b, c, d, e, f, x, y;
    vector<xy> results;
    
    cout.precision(3);
    cout << fixed << showpoint;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double coef = d/a;
        b *= coef; c *= coef;
        y = (c - f)/(b - e);
        x = (f - e*y)/d;
        x = round(x*1000.0)/1000.0;
        y = round(y*1000.0)/1000.0;
        if (x == 0) x = fabs(x);
        if (y == 0) y = fabs(y);
        results.push_back( {x,y} );
        // cout << x << " " << y << endl;
    }
    for (vector<xy>::iterator itr = results.begin();
         itr != results.end(); ++itr) {
        // xy& tmp = *itr;
        cout << itr->x << " " << itr->y << endl;
    }
}

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

using namespace std;

int main() {
	int i=0;
	int a[10000], b[10000], c[10000], d[10000], e[10000], f[10000];
	while (1) {
		cin >> a[i] >> b[i] >> c[i] >> d[i] >> e[i] >> f[i];
		if (a[i] == 0 && b[i] == 0 && c[i] == 0 && d[i] == 0 && e[i] == 0 && f[i] == 0)break;
		i++;
	}
	int x[10000], y[10000];
	for (int j = 0; j < i; j++) {
		y[j] = (double)(c[j] * d[j] - a[j] * f[j]) / (double)(b[j] * d[j] - a[j] * e[j]);
		x[j] = (double)(c[j] * e[j] - b[j] * f[j]) / (double)(a[j] * e[j] - b[j] * d[j]);
		printf("%d.3f %d.3f\n", x[j], y[j]);
	}
	return 0;
}