Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. double x,y;
  8. double a,aa,b,bb,c,cc;
  9. double w,wx,wy;
  10.  
  11. printf("c=a*x+b*y\n");
  12. printf("cc=aa*x+bb*y\n");
  13.  
  14. printf("Podaj c\n");
  15. scanf("%lf",&c);
  16. printf("Podaj a\n");
  17. scanf("%lf",&a);
  18. printf("Podaj b\n");
  19. scanf("%lf",&b);
  20. printf("Podaj cc\n");
  21. scanf("%lf",&cc);
  22. printf("Podaj aa\n");
  23. scanf("%lf",&aa);
  24. printf("Podaj bb\n");
  25. scanf("%lf",&bb);
  26.  
  27. w=a*bb-b*aa;
  28. wx=c*bb-b*cc;
  29. wy=a*cc-c*aa;
  30.  
  31. printf("przed\n");
  32. printf("w= %lf\n",w);
  33. printf("wx= %lf\n",wx);
  34. printf("wy= %lf\n",wy);
  35. printf("po\n");
  36. if(w!=0)
  37. {
  38. x=wx/w;
  39. y=wy/w;
  40. printf("w= %lf\n",w);
  41. printf("wx= %lf\n",wx);
  42. printf("wy= %lf\n",wy);
  43. printf("x= %lf\n",x);
  44. printf("y= %lf\n",y);
  45. }
  46. else
  47. {
  48. if(w==0 && wx==0 && wy==0)
  49. {
  50. printf("Istnieje nieskonczona ilosc rozwiazan\n");
  51. }
  52. if(w==0 && wx!=0 && wy!=0)
  53. {
  54. printf("Nie istnieja rozwiazania\n");
  55. }
  56. }
  57.  
  58. system("PAUSE");
  59. return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement