forked from mpfeifer1/Kattis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
abc.cpp
36 lines (31 loc) · 767 Bytes
/
abc.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main() {
vector<int> v;
v.resize(3);
cin >> v[0] >> v[1] >> v[2];
sort(v.begin(), v.end());
string s;
cin >> s;
if(s == "ABC") {
cout << v[0] << " " << v[1] << " " << v[2] << endl;
}
if(s == "ACB") {
cout << v[0] << " " << v[2] << " " << v[1] << endl;
}
if(s == "BAC") {
cout << v[1] << " " << v[0] << " " << v[2] << endl;
}
if(s == "BCA") {
cout << v[1] << " " << v[2] << " " << v[0] << endl;
}
if(s == "CAB") {
cout << v[2] << " " << v[0] << " " << v[1] << endl;
}
if(s == "CBA") {
cout << v[2] << " " << v[1] << " " << v[0] << endl;
}
}