Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- float a, b, c;
- void sortare(float &a, float &b, float &c)
- {
- if (a < b) swap(a, b);
- if (b < c)
- {
- swap(b, c);
- if (a < b)
- swap(a, b);
- }
- }
- int main()
- {
- cin>>a>>b>>c;
- sortare(a,b,c);
- cout<<a<<' '<<b<<' '<<c;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement