forked from daiwb/Algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA.cpp
More file actions
56 lines (48 loc) · 1.04 KB
/
Copy pathA.cpp
File metadata and controls
56 lines (48 loc) · 1.04 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <iostream>
#include <string>
#include <map>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
string ct[] = {
"y qee",
"ejp mysljylc kd kxveddknmc re jsicpdrysi",
"rbcpc ypc rtcsra dkh wyfrepkym veddknkmkrkcd",
"de kr kd eoya kw aej tysr re ujdr lkgc jv"
};
string pt[] = {
"a zoo",
"our language is impossible to understand",
"there are twenty six factorial possibilities",
"so it is okay if you want to just give up"
};
map<char, char> mp;
void init() {
mp['z'] = 'q';
REP(i,4) {
REP(j,ct[i].length()) {
if (pt[i][j] == ' ') continue;
mp[ct[i][j]] = pt[i][j];
}
}
}
string str;
void run() {
getline(cin, str);
REP(i,str.length()) {
if (str[i] == ' ') continue;
str[i] = mp[str[i]];
}
cout << str << endl;
}
int main() {
init();
int k;
cin >> k;
getline(cin, str);
FOR(c,1,k) {
cout << "Case #" << c << ": ";
run();
}
return 0;
}