Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "iostream"
- void Ordina(int* a, int* b, int* c);
- using namespace std;
- int main()
- {
- int a=10,b=4,c=8;
- Ordina(&a,&b,&c);
- cout<<a<<' '<<b<<' '<<c<<endl;
- system("PAUSE");
- return 0;
- }
- void Ordina(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