Untitled
user_1395366495
plain_text
3 years ago
737 B
6
Indexable
#include<stdio.h> int main(){ double a1, b1, c1, a2, b2, c2; double D, Dx, Dy, x, y; scanf("%lf", &a1); scanf("%lf", &b1); scanf("%lf", &c1); scanf("%lf", &a2); scanf("%lf", &b2); scanf("%lf", &c2); D = a1 * b2 - a2 * b1; Dx = c1 * b2 - c2 * b1; Dy = a1 * c2 - a2 * c1; if (D == 0) { if (Dx == 0 && Dy == 0) printf("VOSONGHIEM"); else if (Dy = !0) printf("VONGHIEM"); else if (Dx != 0) printf("VONGHIEM"); } else { x = (double)Dx / D; y = (double)Dy / D; if(x == -0.0 ) x = fabs(x); if(y == -0.0 ) y = fabs(y); printf("%.2lf %.2lf", x, y); } return 0; }
Editor is loading...