Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. float a, b, c;
  6. cout<<"Podaj 3 kolejne liczby:"<<endl;
  7. cin>>a>>b>>c;
  8. if((a>b)&&(a>c))
  9. {
  10. if(b>c)
  11. {
  12. cout<<"Mediana wynosi:"<<b<<endl;
  13. }
  14. else
  15. {
  16. cout<<"Mediana wynosi:"<<c<<endl;
  17. }
  18. }
  19. else if((b>a)&&(b>c))
  20. {
  21. if(a>c)
  22. {
  23. cout<<"Mediana wynosi:"<<a<<endl;
  24. }
  25. else
  26. {
  27. cout<<"Mediana wynosi:"<<c<<endl;
  28. }
  29. }
  30. else
  31. {
  32. if(a>b)
  33. {
  34. cout<<"Mediana wynosi:"<<a<<endl;
  35. }
  36. else
  37. {
  38. cout<<"Mediana wynosi:"<<b<<endl;
  39. }
  40. }
  41.  
  42.  
  43.  
  44.  
  45. if((a>b)&&(a>c))
  46. {
  47. cout<<"Maksimum wynosi:"<<a<<endl;
  48. }
  49. else if((b>a)&&(b>c))
  50. {
  51. cout<<"Maksimum wynosi:"<<b<<endl;
  52. }
  53. else
  54. {
  55. cout<<"Maksimum wynosi:"<<c<<endl;
  56. }
  57.  
  58.  
  59.  
  60. if((a<b)&&(a<c))
  61. {
  62. cout<<"Minimum wynosi:"<<a<<endl;
  63. }
  64. else if((b<a)&&(b<c))
  65. {
  66. cout<<"Minimum wynosi"<<b<<endl;
  67. }
  68. else
  69. {
  70. cout<<"Minimum wynosi:"<<c<<endl;
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement