Advertisement
Guest User

Obliczanie największej liczby

a guest
Jan 18th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int x, y, z;
  5. int main()
  6.  
  7. {
  8. cout<<"Podaj 1 liczbe: ";
  9. cin>> x;
  10. cout<<"Podaj 2 liczbe: ";
  11. cin>> y;
  12. cout<<"Podaj 3 liczbe: ";
  13. cin>> z;
  14.  
  15. if(y&&z<x)
  16. {
  17. cout<<"Najwieksza jest pierwsza wytypowana liczba "<<x<<endl;
  18. }
  19. if(x&&z<y)
  20. {
  21. cout<<"Najwieksza jest druga wytypowana liczba "<<y<<endl;
  22. }
  23.  
  24. if(x&&y<z)
  25. {
  26. cout<<"Najwieksza jest druga wytypowana liczba trzecia "<<z<<endl;
  27.  
  28. }
  29. if(x&&y==z)
  30. {
  31. cout<<"Wszystkie liczby sa takie same"<<endl;
  32. }
  33.  
  34. system("PAUSE");
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement