Go: package main

import "fmt"

func main() {
	var Xs, Ys []float32
	Xs = make([]float32, 0)
	Ys = make([]float32, 0)
	var cnt int
	for {
		var a, b, c, d, e, f, x, y float32
		fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if a == 0 {
			break
		}
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		Xs = append(Xs, x)
		Ys = append(Ys, y)
		cnt++
	}
	for i := 0; i < cnt; i++ {
		fmt.Printf("%.3f %.3f\n", Xs[i], Ys[i])
	}
}

C++:  /*
Write a program which solve a simultaneous equation:

        ax + by = c
        dx + ey = f
The program should print x and y for given a, b, c, d, e and f(-1000 &#8804; a, b, c, d, e, f &#8804; 1000). You can suppose that given equation has a unique solution.
 */

#include <iostream>
#include <cstdio>

using namespace std;

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

int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		solve(a,b,c,d,e,f);
	}
	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 M[2][3] = { 
            {a, b, c},
            {d, e, f}
        };
        double d = 0, m = 0;
        for(int i=0; i<2; ++i)
        {  
            d = M[i][i];
            for(int j=0; j<3; ++j){
                M[i][j] = M[i][j] / d;
            }
            for(int k = i+1; k<2; k++){
                m = M[k][i];
                for(int n = i; n<3; ++n){
                    M[k][n] = M[k][n] - m * M[i][n];
                }
            }
        }
        
        for(int i = 1; i>0; --i){
            for(int j= i-1; j>=0; --j){
                d = M[j][i];
                for(int n=i; n<3; ++n){
                    M[j][n] = M[j][n] - d * M[i][n];
                }
            }
        }
        for(int i=0; i<2; i++){
            if(i == 1) {
                cout << M[i][2] << endl; break;
            }
            cout << fixed << M[i][2] << " ";
            
        }
    }
    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);
		printf("%.3f %.3f\n", x, y);
	}
}

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

C++: #include <cstdio>
#include <stdlib.h>
#include <math.h>

float a,b,c,d,e,f;
double    round( double val, int precision )
{
    double    ret;
    char    buf[256] = {'\0'};
    char    *p;

    sprintf( buf, "%.*f", precision, val );
    ret = strtod( buf, &p );

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

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

int main()
{
	double a, b, c, d, e, f;
	for (; cin >> a >> b >> c >> d >> e >> f;)
	{
		double x, y;
		if (a == 0 || b == 0 || d == 0 || e == 0)
		{
			if (a == 0)
			{
				y = c / b;
				x = (f - e * y) / d;
			}
			else if (b == 0)
			{
				x = c / a;
				y = (f - d * x) / e;
			}

			if (d == 0)
			{
				y = f / e;
				x = (c - b * y) / a;
			}
			else if (e == 0)
			{
				x = f / d;
				y = (c - a * x) / b;
			}
		}
		else
		{
			double a0 = a * e;
			double c0 = c * e;

			double d0 = d * b;
			double f0 = f * b;

			x = (f0 - c0) / (d0 - a0);

			y = (c - a * x) / b;
		}

		if (x == 0)
		{
			x = abs(x);
		}
		if (y == 0)
		{
			y = abs(y);
		}

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

	}
}

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

double get(double a){
    if(abs(a) < 1e-9)return 0;
    return a;
}

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

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

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

	std::cout << std::fixed << std::setprecision(3);
	while (std::cin >> a >> b >> c >> d >> e >> f) {
		x = (c * e - b * f) / (a * e - b * d);
		y = (c * d - a * f) / (b * d - a * e);
		if (x == -0) x = 0;
		if (y == -0) y = 0;
		std::cout << x << " " << y << std::endl;
	}

	return 0;
}

C++: #include <iostream>
#include<stdio.h>
int main(){
	long double a, b, c, d, e, f,x,y;
	while (std::cin >> a >> b >> c >> d >> e >> f) {
		x = (b*f - e * c) / (d*b - a * e);
		y = (a*f - d * c) / (a*e - d * b);
		if (x < 0)
			x = (double)((int)(1000 * x - 0.5)) / 1000;
		else
			x = (double)((int)(1000 * x + 0.5)) / 1000;
		if (y < 0)
			y = (double)((int)(1000 * y - 0.5)) / 1000;
		else
			y = (double)((int)(1000 * y + 0.5)) / 1000;
		printf("%.3llf %.3llf\n", x, y);
	}
	return 0;
}

C++: #include<stdio.h>

int main(){
	double a,b,c,d,e,f,x,y,x2,y2;
	int status;
	while(1){
		status=scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
		if (status==EOF){
			break;
		}
		x=(f/e-c/b)/(d/e-a/b);
		y=c/b-a*x/b;
		x2=(b*f-c*e)/(b*d-a*e);
		y2=(c-a*x2)/b;
		x=x2;
		y=y2;
		
		if (x<0.0005 && x>-0.0005){
			x=0;
		}
		if (y<0.0005 && y>-0.0005){
			y=0;
		}
		printf("%.3f %.3f\n",x,y);
		printf("%f %f\n",x,y);
		printf("%.3f %.3f\n",x2,y2);
		printf("%f %f\n\n\n",x2,y2);
	}
	
	return 0;
}