Guest User

Untitled

a guest
Oct 20th, 2011
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<math.h>
  4.  
  5. int main()
  6. {
  7. float a1,b1,c1,a2,b2,c2,W,Wx,Wy,x,y;
  8.  
  9. printf("Poda a1: ");
  10. scanf("%f",&a1);
  11. printf("Poda b1: ");
  12. scanf("%f",&b1);
  13. printf("Poda c1: ");
  14. scanf("%f",&c1);
  15. printf("Poda a2: ");
  16. scanf("%f",&a2);
  17. printf("Poda b2: ");
  18. scanf("%f",&b2);
  19. printf("Poda c2: ");
  20. scanf("%f",&c2);
  21.  
  22. W = a1*b2-b1*a2;
  23. Wx = c1*b2-b1*c2;
  24. Wy = a1*c2-c1*a2;
  25.  
  26. if (W != 0){
  27. printf("Równanie ma jedno rozwiazanie\n");
  28. x = Wx/W;
  29. y = Wy/W;
  30. printf("x=%.2f \n y=&.2f \n",x,y);
  31. }
  32. if (W ==0 && Wx == 0 && Wy == 0){
  33. printf("Rownanie ma nieskonczenie wiele rozwiazan\n");
  34. }
  35. if ((W==0 && Wx != 0) || (W==0 && Wy !=0)){
  36. printf("Rowananie jest sprzeczne, brak rozwiazan\n");
  37. }
  38. system("PAUSE");
  39. return 0;
  40. }
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment