Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdio>
- using namespace std;
- void Posortuj(float& fA, float& fB, float& fC)
- {
- if (fA<fB && fA<fC)
- {
- if (fB<fC) cout<<fA<<", "<<fB<<", "<<fC;
- else cout<<fA<<", "<<fC<<", "<<fB;
- }
- else if (fB<fA && fB<fC)
- {
- if (fA<fC) cout<<fB<<", "<<fA<<", "<<fC;
- else cout<<fB<<", "<<fC<<", "<<fA;
- }
- else
- {
- if (fA<fB) cout<<fC<<", "<<fA<<", "<<fB;
- else cout<<fC<<", "<<fB<<", "<<fA;
- }
- }
- int main()
- {
- float fA, fB, fC;
- cout<<"Podaj trzy liczby, a wypisze je rosnaco!"<<endl;
- cin>>fA>>fB>>fC;
- Posortuj(fA, fB, fC);
- getchar();
- cin.ignore();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement