Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main()
  6. {
  7. float a,b,c,d,e,f,x,y,Wx,Wy,W;
  8.  
  9. printf("Podaj wspolczynniki: \n a:");
  10. scanf("%f", &a);
  11. printf("\n b:");
  12. scanf("%f", &b);
  13. printf("\n c:");
  14. scanf("%f", &c);
  15. printf("\n d:");
  16. scanf("%f", &d);
  17. printf("\n e:");
  18. scanf("%f", &e);
  19. printf("\n f:");
  20. scanf("%f", &f);
  21.  
  22. Wx=(c*e)-(f*b);
  23. Wy=(a*f)-(c*d);
  24. W=(a*e)-(d*b);
  25.  
  26. x=(Wx/W);
  27. y=(Wy/W);
  28.  
  29.  
  30. if (W!=0.0) { printf("Ukl. rownan ma 1 pare rozwiazan postaci: x=%f",x);
  31. printf("oraz y=%f",y); }
  32. if (W==0.0 && Wx==0.0 && Wy==0.0) { printf("Uklad jest nieoznaczony"); }
  33. if (W==0.0 && (Wx!=0.0 || Wy!=0.0)) { printf("Uklad jest sprzeczny"); }
  34.  
  35.  
  36. system("PAUSE");
  37. return(0);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement