Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4. float a, b, c;
  5.  
  6. void sortare(float &a, float &b, float &c)
  7. {
  8. if (a < b) swap(a, b);
  9. if (b < c)
  10. {
  11. swap(b, c);
  12. if (a < b)
  13. swap(a, b);
  14. }
  15. }
  16. int main()
  17. {
  18. cin>>a>>b>>c;
  19. sortare(a,b,c);
  20. cout<<a<<' '<<b<<' '<<c;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement