20분 컷했당 쉽다.
#include<iostream> #include<algorithm> #include<vector> using namespace std; int main(){ int num; int i, j; string temp; vector<string> input_string; cin >> num; for(i = 0; i < num; i++){ cin >> temp; input_string.push_back(temp); } for(i = 0; i < num; i++){ for(j = 0; j < input_string[i].length(); j++){ if(input_string[i][j] == '%' && input_string[i][j+1] == '2'){ switch (input_string[i][j+2]) { case '0': cout << " "; j+=2; break; case '1': cout << "!"; j+=2; break; case '4': cout << "$"; j+=2; break; case '5': cout << "%"; j+=2; break; case '8': cout << "("; j+=2; break; case '9': cout << ")"; j+=2; break; case 'a': cout << "*"; j+=2; break; default : cout << input_string[i][j]; break; } } else cout << input_string[i][j]; } cout << endl; } }
'programming > 알고스팟' 카테고리의 다른 글
알고스팟 - 튜토리얼 XHAENEUNG (0) | 2020.05.16 |
---|---|
알고스팟 - 튜토리얼 HOTSUMMER (0) | 2020.05.15 |
알고스팟 - 튜토리얼 mispell (0) | 2020.05.14 |
알고스팟 - 튜토리얼 encrypt (0) | 2020.05.14 |
알고스팟 - 튜토리얼 LECTURE (0) | 2020.05.14 |
댓글