Created
January 26, 2018 21:49
-
-
Save chermehdi/81745b94c21deceb1a864d87e3a8da97 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <stdio.h> | |
#include <iostream> | |
#include <map> | |
using namespace std; | |
const int N = 1e6; | |
int main(){ | |
int arr[3]; | |
for(int i = 0; i < 3; i++) cin >> arr[i]; | |
sort(arr, arr + 3); | |
string s; cin >> s; | |
map<char, int> m; | |
m['C'] = arr[2]; | |
m['B'] = arr[1]; | |
m['A'] = arr[0]; | |
for(int i = 0; i < s.length(); i++){ | |
if(i > 0) cout << " "; | |
cout << m[s[i]]; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment