Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- double X,Y,a1,a2,b1,b2,c1,c2;
- int t,i;
- scanf("%d",&t);
- for(i=0;i<t;i++)
- {
- scanf("%lf %lf %lf %lf %lf %lf",&a1,&b1,&c1,&a2,&b2,&c2);
- if(c1>0 || c1<0)
- {c1=-(c1);}
- if(c2>0 || c2<0)
- {c2=-(c2);}
- X=((b1*c2)-(b2*c1))/((a1*b2)-(a2*b1));
- Y=((c1*a2)-(c2*a1))/((a1*b2)-(a2*b1));
- printf("Case %d:\n",i+1);
- printf("X = %.2lf Y = %.2lf\n",X,Y);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement