Guest User

Untitled

a guest
Jan 11th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. void sortowanie(int a, int b, int c, int x1, int x2, int x3)
  2. {
  3. if(a>b>c)
  4. {
  5. x1==c; x2==b; x3=a;
  6. }
  7. if(c>b>a)
  8. {
  9. x1==a; x2==b; x3==c;
  10. }
  11. if(b>c>a)
  12. {
  13. x1==a; x2==c; x3==b;
  14. }
  15. if(b>a>c)
  16. {
  17. x1==c; x2==a; x3==b;
  18. }
  19. if(a>c>b)
  20. {
  21. x1==b; x2==c; x3==a;
  22. }
  23. if(c>a>b)
  24. {
  25. x1==b; x2==a; x3==c;
  26. }
  27. }
  28.  
  29. int main()
  30. {
  31. int a, b, c;
  32.  
  33. int x1, x2, x3;
  34.  
  35. cout << "Podaj a: ";
  36. cin >> a;
  37. cout << "Podaj b: ";
  38. cin >> b;
  39. cout << "Podaj c: ";
  40. cin >> c;
  41. cout << endl;
  42.  
  43. sortowanie(a, b, c, x1, x2, x3);
  44. cout << "Posortowane wartosci to: " << x1 << " " << x2 << " " << x3;
  45.  
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment