| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
water!!!#include <iostream>
#include <cstdlib>
#include <string>
#include <map>
using namespace std;
int main() {
string str;
map <char,char> ks;
ks['A'] = 'V';ks['B'] = 'W';ks['C'] = 'X';ks['D'] = 'Y';ks['E'] = 'Z';ks['F'] = 'A';ks['G'] = 'B';ks['H'] = 'C'; ks['I'] = 'D';ks['J'] = 'E';ks['K'] = 'F';ks['L'] = 'G';ks['M'] = 'H';ks['N'] = 'I';ks['O'] = 'J';ks['P'] = 'K';ks['Q'] = 'L';ks['R'] = 'M';ks['S'] = 'N';ks['T'] = 'O';ks['U'] = 'P';ks['V'] = 'Q';ks['W'] = 'R';ks['X'] = 'S';ks['Y'] = 'T';ks['Z'] = 'U';
while (getline(cin,str),str != "ENDOFINPUT") {
if (str == "START" || str == "END") continue;
for (int i = 0;i < (int)str.length();i++)
if (str[i] >= 'A' && str[i] <= 'Z') cout << ks[str[i]];
else if (str[i] >= 'a' && str[i] <= 'z') cout << ks[str[i]-32]+32;
else cout << str[i];
cout << '\n';
}
return EXIT_SUCCESS;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator