Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sortowanie(int a, int b, int c, int x1, int x2, int x3)
- {
- if(a>b>c)
- {
- x1==c; x2==b; x3=a;
- }
- if(c>b>a)
- {
- x1==a; x2==b; x3==c;
- }
- if(b>c>a)
- {
- x1==a; x2==c; x3==b;
- }
- if(b>a>c)
- {
- x1==c; x2==a; x3==b;
- }
- if(a>c>b)
- {
- x1==b; x2==c; x3==a;
- }
- if(c>a>b)
- {
- x1==b; x2==a; x3==c;
- }
- }
- int main()
- {
- int a, b, c;
- int x1, x2, x3;
- cout << "Podaj a: ";
- cin >> a;
- cout << "Podaj b: ";
- cin >> b;
- cout << "Podaj c: ";
- cin >> c;
- cout << endl;
- sortowanie(a, b, c, x1, x2, x3);
- cout << "Posortowane wartosci to: " << x1 << " " << x2 << " " << x3;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment