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 <iomanip>

using namespace std;

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

		cout << x << ' ' << y << endl;
	}
	return 0;
}

C++: #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) {
		x = (c * e - b * f) / (a * e - b * d);
		y = (a * f - c * d) / (a * e - b * d);
		if ((int)(x * 1000) - x * 1000 >= 0.5) {
			x = ((int)(x * 1000 + 0.5)) / 1000;
		}
		else { x = ((int)(x * 1000)) / 1000; }
		if ((int)(y * 1000) - y * 1000 >= 0.5) {
			y = ((int)(y * 1000 + 0.5)) / 1000;
		}
		else { y = ((int)(y * 1000)) / 1000; }
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
	double a,b,c,d,e,f,n[20];
	while(cin>>a>>b>>c>>d>>e>>f){
	double x,y;
	int w;
	if(a == 0){
		n[0] = 0;
		n[1] = 0;
	}else{
		n[0] = c / a;
		n[1] = b / a;
	}
	if(d == 0){
		n[2] = 0;
		n[3] = 0;
	}else{
		n[2] = f / d;
		n[3] = e / d;
	}
	if(b == 0){
		n[4] = 0;
		n[5] = 0;
	}else{
		n[4] = c / b;
		n[5] = a / b;
	}
	if(e == 0){
		n[6] = 0;
		n[7] = 0;
	}else{
		n[6] = f / e;
		n[7] = d / e;
	}
	if(n[1] - n[3] == 0){
		y = 0;
	}else{
		y = (n[0] - n[2]) / (n[1] - n[3]);
	}
	if(n[5] - n[7] == 0){
		x = 0;
	}else{
		x = (n[4] - n[6]) / (n[5] - n[7]);
	}
	x = x * pow(10, - 5);
	double xx = x + 0.5;
	xx = xx * pow(10,5);
	y = y * pow(10, - 5);
	double yy = y + 0.5;
	yy = yy * pow(10,5);

	printf("%04f,%04f\n",&xx,&yy);



}
return 0;
}

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

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

C++: #include<stdio.h>
float calcy(float,float,float,float,float,float);
float calcx(float,float,float,float);
int main(void)
{
	int a,b,c,d,e,f;
	float x,y;
	for(int i=0;i<2;i++){
		scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
		y=calcy(a,b,c,d,e,f);
		x=calcx(a,b,c,y);
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}
float calcy(float a,float b,float c,float d,float e,float f){
	float y;
	b=b/a*-1;
	c=c/a;
	b=d*b;
	c=d*c;
	e=b+e;
	f=f-c;
	y=f/e;
	return y;
}
float calcx(float a,float b,float c,float y){
	float x;
	b=b*y;
	c=c-b;
	x=c/a;
	return x;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main()

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

C++: #include<stdio.h>

int main()
{
	int a[100],b[100],c[100],d[100],e[100],f[100],count=0,i;
	double x[100],y[100];
	while(scanf("%d %d %d %d %d %d",&a[count],&b[count],&c[count],&d[count],&e[count],&f[count]) != EOF){
		count++;
	}
	for(i=0;i<count;i++){
		if(d[i]!=0){
			y[i]=1.0*(c[i]*d[i]-a[i]*f[i])/(b[i]*d[i]-a[i]*e[i]);
			x[i]=(1.0*(-e[i])/d[i]*y[i])+(1.0*f[i]/d[i]);
		}else{
			y[i]=1.0*f[i]/e[i];
			x[i]=1.0*(c[i]*e[i]-b[i]*f[i])/(a[i]*e[i]);
		}
		x[i]+=0.0005;
		y[i]+=0.0005;
		printf("%.3f %.3f\n",x[i],y[i]);
	}

	return 0;
}

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


int main() {
	ios::sync_with_stdio(false);
	int a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double x = (e*c-b*f)/(a*e-b*d);
		double y = (-c*d+a*f)/(a*e-b*d);
		cout << fixed << setprecision(3) << x << " " << y << "\n";
	}

}

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

int main(){

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

	double x,y;

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

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

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define REP(i,N) for(int i = 0; i < (int)N; i++)

double det(double a1,double a2,double a3,double a4){
	return a1*a4-a2*a3;
}

int main(){
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double g,h,i;
		g = det(a,b,d,e);
		h = det(c,b,f,e);
		i = det(a,c,d,f);
		double j,k;
		j = h/g;
		k = i/g;
		j = round(j*pow(10,4))/pow(10,4);
		k = round(k*pow(10,4))/pow(10,4);
		printf("%.3f %.3f\n",j,k);
	}
	return 0;
}

C++: #include <cstdio>
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) != EOF) {
        double x, y;
        if (a * f != c * d && b * f == c * e) {
            x = 0;
            y = (double)c / b;
        }
        else if (a * f == c * d && b * f != c * e) {
            x = (double)c / a;
            y = 0;
        }
        else {
            x = ((double)a*e-b*d)/(c*e-b*f);
            y = ((double)c*d-a*f)/(b*d-e*a);
        }
        printf("%.3f %.3f\n", x, y);
    }
    return 0;
}

C++: #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;}
		cout<<setprecision(3)<<fixed;
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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

template <typename T> double round(const T r, const int n = 0){
    if(r>=0){
        return floor(r + 5 * pow(10, n));
    }
    else{
        return ceil(r - 5 * pow(10, n));
    }
}

int main(){
    double a, b, c, d, e, f;
	while(std::cin >> a){
		std::cin >> b >> c >> d >> e >> f;
		std::cout << std::fixed << std::setprecision(3)
			<< round((c * e - b * f) / (a * e - b * d), -3) << ' '
			<< round((a * f - c * d) / (a * e - b * d), -3) << std::endl;
	}
	return 0;
}

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

int main()
{
	std::vector<double> x, y;
	double a, b, c, d, p, q;
	while (scanf("%d %d %d %d %d %d", &a, &b, &p, &c, &d, &q) != EOF)
	{
		x.push_back((d*p - b*q) / (a*d - b*c));
		y.push_back((a*q - c*p) / (a*d - b*c));
	}
	
	for (int i = 0; i < x.size(); ++i)
		std::cout << roundf(x[i]+0.0005) << " " << roundf(y[i]+ 0.0005) << std::endl;
	return 0;
}

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

struct xy
{
	double x;
	double y;
};
int main()
{
	double a, b, c, d, e, f,x,y;
	vector<xy> dst;
	while (cin>> a >> b >> c >> d >> e >> f) {
		y = (f - d / a * c) / (e - d / a * b);
		x = (c - b * y) / a;
		dst.push_back({ x,y });
	}
	for (vector<xy>::iterator it = dst.begin(); it < dst.end(); it++) {
		cout.setf(ios::fixed);
		cout << fixed << setprecision(3) << (*it).x<<" "<<(*it).y << endl;
	}
	return 0;
}