Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "iostream"
- void OrdinaRiferimento (int& a, int& b, int& c);
- using namespace std;
- int main()
- {
- int a=8,b=4,c=10;
- OrdinaRiferimento (a,b,c);
- cout<<a<<' '<<b<<' '<<c<<endl;
- system("PAUSE");
- return 0;
- }
- void OrdinaRiferimento(int& a, int& b, int& c)
- {
- int temp;
- if (a>b)
- {
- temp=a;
- a=b;
- b=temp;
- }
- if (a>c)
- {
- temp=a;
- a=c;
- c=temp;
- }
- if (b>c)
- {
- temp=b;
- b=c;
- c=temp;
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement