Language: C++

#include <stdio.h>

//#define DEBUGNOW

#ifdef DEBUGNOW
#define debug
#else
#define debug 1 ? (void)0 :
#endif

double sishagonyu(double num)	{
	
	//int num2;
	
	if (num == 0) return num;
	
	if (num > 0) { num += 0.0005; }
	else { num -= 0.0005; }
	
	num = (double)(int)(num * 1000) / 1000;
	
	//	num *= 1000;
	//	num2 = (int)num;
	//	num = num2;
	//	num /= 1000;
	
	return num;
}

int main() {
	
	//printf("%.3lf", sishagonyu((double)-0.0015));
	
	
	double a, b, c, d, e, f;
	double x, y;
	
	double n, m, h, i;
	
	while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
		
		//if (scanf("%lf %lf %lf %lf %lf %f", &a, &b, &c, &d, &e, &f) == EOF) break;
		
		debug printf("input:\n%f %f %f\n%f %f %f\n", a, b, c, d, e, f);	//input
		
		if (a == 0) { y = c / b; }
		if (b == 0) { x = c / a; }
		if (d == 0) { y = f / e; }
		if (e == 0) { x = f / d; }
		
		n = a / d;
		
		//j = d * n;
		h = e * n;
		i = f * n;
		
		debug printf("%f %f %f\t%f %f\t%f\n", a, b, c, h, i, n);
		
		m = b - h;
		y = c - i;
		debug printf("%f %f\n", m, y);
		
		if(y <= 0.0004 && y >= -0.0005) { 
			
			debug printf("y = 0\n");
			y = 0; 
			
		} else {
			
			y /= m;
			debug printf("%f\n", y);
			
			i = c - (b * y);
			x = i / a;
			
			debug printf("x = %f, y = %f\n", x, y);
			
			x = sishagonyu(x);
			y = sishagonyu(y);
			
		}
		//printf("%f %f\n", x, y);
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}
//2.2 3.3 22.24706 3.2 8.7 50.12932
//3.2777 4.5564

//1 2 3 4 5 6
//-1.000 2.000

//2 -1 -2 -1 -1 -5
//1.000 4.000

//2 -1 -3 1 -1 -3
//0.000 3.000

// 2 -1 -3 -9 9 27
// 0.000 3.000

Compiler output:
a.cc: In function 'int main()':
a.cc:44:29: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void'
   44 |                 debug printf("input:\n%f %f %f\n%f %f %f\n", a, b, c, d, e, f); //input
      |                       ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:57:29: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void'
   57 |                 debug printf("%f %f %f\t%f %f\t%f\n", a, b, c, h, i, n);
      |                       ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:61:29: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void'
   61 |                 debug printf("%f %f\n", m, y);
      |                       ~~~~~~^~~~~~~~~~~~~~~~~
a.cc:65:37: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void'
   65 |                         debug printf("y = 0\n");
      |                               ~~~~~~^~~~~~~~~~~
a.cc:71:37: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void'
   71 |                         debug printf("%f\n", y);
      |                               ~~~~~~^~~~~~~~~~~
a.cc:76:37: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void'
   76 |                         debug printf("x = %f, y = %f\n", x, y);
      |                               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~