Advertisement
Jayss8

WCIPEG Task ABC (C++)

Jul 6th, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int n[3];
  9.     char c[3];
  10.  
  11.     cin >> n[0] >> n[1] >> n[2];
  12.     sort(n, n + 3);
  13.     cin >> c;
  14.  
  15.     for (int i = 0; i < 3; i++)
  16.     {
  17.         cout << n[c[i] - 'A'] << " ";
  18.     }
  19.     cout << endl;
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement