Guest User

Untitled

a guest
Feb 20th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4.  
  5. void zamien_miejscami (int&x, int &y)
  6. {
  7. int temp = x;
  8. x = y;
  9. y = temp;
  10. }
  11. int main ()
  12. {
  13. int a,b,c;
  14. cout << "podaj wartosci a b c ";
  15. cin>>a>>b>>c;
  16. if (a>b) zamien_miejscami(a,b);
  17. if (a>c) zamien_miejscami (a,c);
  18. if (b>c) zamien_miejscami (b,c);
  19. cout << "wartosci liczb a,b c po zamianach: " << a <<" " << b << " " << c;
  20. cin.ignore();
  21. getchar();
  22. return 0;
  23. }
Add Comment
Please, Sign In to add comment