fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. float a1,b1,c1,a2,b2,c2,d,dy,dx;
  6. int i,n;
  7. printf ("Nhap n = ");
  8. scanf ("%d",n);
  9. for (i = 1; i <= n; i++)
  10. {
  11. printf ("Nhap cac he so : ");
  12. scanf ("%f%f%f%f%f%f",&a1,&b1,&c1,&a2,&b2,&c2);
  13. d = a1*b2 - a2*b1;
  14. dx = c1*b2 - b1*c2;
  15. dy = a1*c2 - a2*c1;
  16.  
  17. if (d != 0)
  18. printf ("%.2f %.2f", dx/d, dy/d);
  19. else if (dx != 0)
  20. printf ("no solution");
  21. else
  22. printf ("many solution");
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
Nhap n =