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<stdio.h>
#include<algorithm>
using namespace std;
int main(){
         double a,b,c,d,e,f,x,y;
		 scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f);
		 y = (c*d-f*a)/(b*d-a*e);
		 x = (c-b*y)/a;
		 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;
  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);
    if(x==-0){
      x=0;
    }
    y=(d*c-a*f)/(d*b-a*e);
    if(y==-0){
      y=0;
    }
    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

C++: #include <bits/stdc++.h>
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){
		double x,y;
		x = double(e*c-b*f)/(a*e-b*d);
		y = double(a*f-c*d)/(a*e-b*d);
		if(x<=0.00 && x>=-0.00400)x=0.0001;
		if(y<=0.00 && y>-0.00500)y=0.0001;
		printf("%.3lf %.3lf\n",x,y);
	}
}

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;
float a,b,c,d,e,f;
float findoutx,findouty;
float x,y,yadd;
float Timers1,Timers2;
int main()
{
    while((cin >> a >> b >> c >> d >> e >> f))
    {
    Timers1 = a;
    Timers2 = d;
    a=a*Timers2;
    b=b*Timers2;
    c=c*Timers2;
    d=d*Timers1;
    e=e*Timers1;
    f=f*Timers1;

    findouty=b-e;
    yadd = c-f;
    findouty = yadd/findouty;
    b = b*findouty;
    findoutx=(c-b)/a;

    if(findoutx==0)findoutx=0;
    if(findouty==0)findouty=0;



    cout<<fixed<<setprecision(3)<<findoutx << " " <<findouty<<endl;
    }

return 0;
}

C++: #include<iostream>
#include<cmath>
#include<iomanip>
double pow(double x,double y);
using namespace std;
int main(){
  double a,b,c,d,e,f,x,y,g,z,aa,bb;
  while(cin>>a){
    cin>>b>>c>>d>>e>>f;
    g=b;
    z=c;
    c*=d;
    b*=d;
    e*=a;
    f*=a;
    b-=e;
    c-=f;
    y=c/b;
    g*=y;
    z-=g;
    x=z/a;
    aa=round(x);
    bb=round(y);
    cout<<fixed;
    cout<<setprecision(3)<<aa<<' '<<setprecision(3)<<bb<<' '<<endl;
  }
  return(0);
}

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

int main(){
    float a, b, c, d, e, f, x, y, dividedNum1, dividedNum2 = 0;
    while(cin >> a >> b >> c >> d >> e >> f){
        dividedNum1 = a;
        dividedNum2 = d;
        a /= dividedNum1;
        b /=dividedNum1;
        c /= dividedNum1;
        d /= dividedNum2;
        e /= dividedNum2;
        f /= dividedNum2;
        
        float temp1 = b - e;
        float temp2 = c - f;
        
        y = floor(((temp2 / temp1) + 0.0005) * 1000) / 1000;
        x = floor((c - (b * y) + 0.0005)* 1000) / 1000;
        
        cout << fixed << setprecision(3) << x << " " << fixed << setprecision(3) << y << endl;
    }
    return 0;
}

C++: #include <iostream>

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int a,b,c,d,e,f;
    double x,y;
    while (std::cin >> a >> b >> c >> d >> e >> f) {
        int delta = (a * e) - (b * d);
        x = (e * c + -b * f) / (double) delta + 0;
        y = (-d * c + a * f) / (double) delta + 0;
        std::printf("%.3f %.3f\n", x, y);
    }
}

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

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

	return 0;
}

C++: #include <iostream>
#include <cstdio>	// require printf
//#include <fstream>	// require freopen

using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.se2", "r", stdin);
	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 - b*d);
		y = (a*f - c*d) / (a*e - b*d);
		if (x == -0. ){
			x = 0.;
		} // end if
		if (y == -0. ){
			y = 0.;
		} // end if
		
		printf ("%.3lf %.3lf\n", x, y );
	} // end loop
		
	return 0;
}

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

int get_gcd(int a, int b) {
    if (a % b == 0) return b;
    return get_gcd(b, a % b);
}

int main() {
    int a,b;
    while (cin>>a>>b) {
        if (a < b) {
            int tmp = a;
            a = b;
            b = tmp;
        }

        int gcd = get_gcd(a,b);

        int lcm = a * b / gcd;
        cout << gcd << " " << lcm << endl;

    }
    return 0;
}

C++: #include <stdio.h>
int main(){
	float a = 0,b = 0,c = 0,d = 0,e = 0,f = 0;
	float x = 0,y = 0;

	while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f) != EOF){
		b *= d / a;
		c *= d / a;
		a *= d / a;
		y = (c - f) / (b - e);
		x = (c - b * y) / a;

		if(x == -0){
			x = 0;
		}
		printf("%0.3f %0.3f\n",x,y);

	}

	return 0;
}

C++: 
import java.util.*;
import java.lang.*;
import java.math.*;

public class Main {
	
	Scanner sc = new Scanner(System.in);
	
	void run() {
		
		int a,b,c,d,e,f;
		
		while ( sc.hasNext() ) {
			
			a = sc.nextInt();
			b = sc.nextInt();
			c = sc.nextInt();
			d = sc.nextInt();
			e = sc.nextInt();
			f = sc.nextInt();
			
			System.out.printf( "%.3f %.3f\n",(double)(e*c-b*f)/(a*e-b*d)+0.00005,(double)(a*f-c*d)/(a*e-b*d)+0.00005 );
			
		}
		
	}
	
	public static void main(String[] args) {
		
		new Main().run();
		
	}
}

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

int main() {
	int a, b, c, d, e, f;
	std::vector<int> x_vector;
	std::vector<int> y_vector;
	
	while (cin >> a >> b >> c >> d >> e >> f) {
		int x = (b * f - c * e) / (b * d - a * e);
		int y = (c * d - a * f) / (b * d - a * e);

		x_vector.push_back(x);
		y_vector.push_back(y);
	}

	for (int i = 0; i < x_vector.size(); i++) {
		cout << x_vector[i] << " " <<  y_vector[i] << endl;
	}

	return 0;
}

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

using namespace std;

double round(double x)
{
	return (int)(x + 0.5 - (x < 0));
}

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

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <vector>

using namespace std;



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