Guest User

Untitled

a guest
Feb 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 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,d;
  14. cout << "podaj wartosci a b c d ";
  15. cin>>a>>b>>c>>d;
  16. if (a>b) zamien_miejscami(a,b);
  17. if (a>d) zamien_miejscami (a,d);
  18. if (a>c) zamien_miejscami (a,c);
  19. if (b>d) zamien_miejscami (b,d);
  20. if (b>c) zamien_miejscami (b,c);
  21. if (c>d) zamien_miejscami (c,d);
  22. cout << "wartosci liczb a,b c,d po zamianach: " << a <<" " << b << " " << c<< " " <<d;
  23. cin.ignore();
  24. getchar();
  25. return 0;
  26. }
Add Comment
Please, Sign In to add comment