Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- void printOrder(int x, int y, int z);
- void print(int a, int b, int c);
- int main()
- {
- int x,y,z;
- cin>>x>>y>>z;
- printOrder(x,y,z);
- print(x,y,z);
- }
- void printOrder(int x, int y, int z)
- {
- int t1,t2,t3;
- if(x<y && x<z)
- {
- t1 = x;
- if(y<z)
- {
- t2=y;
- t3=z;
- }
- else
- {
- t2=z;
- t3=y;
- }
- }
- else if(y<x && y<z)
- {
- t1=y;
- if(x<z)
- {
- t2=x;
- t3=z;
- }
- else
- {
- t2=z;
- t3=x;
- }
- }
- else
- {
- t1 =z;
- if(x<y)
- {
- t2=x;
- t3=y;
- }
- else
- {
- t2=y;
- t3=x;
- }
- }
- cout << t1 << endl << t2 << endl << t3 << endl << endl;
- }
- void print(int x, int y, int z)
- {
- cout << x << endl << y << endl << z << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement