-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcaser.cpp
More file actions
74 lines (70 loc) · 952 Bytes
/
caser.cpp
File metadata and controls
74 lines (70 loc) · 952 Bytes
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include"header_file.h"
#include<cstring>
using namespace std;
void ctp(string s)
{
for(int i=0;i<s.size();i++)
{
switch (s[i])
{
case 'A':
s[i]='V';
break;
case 'B':
s[i]='W';
break;
case 'C':
s[i]='X';
break;
case 'D':
s[i]='Y';
break;
case 'E':
s[i]='Z';
break;
case 'F':
s[i]='A';
break;
default:
s[i]=s[i];
break;
}
}
//for(int i=0;i<s.size();i++)
//{
cout<<s<<endl;
//}
}
int main(void)
{
vector<string> v;
string s;
getline(cin,s);
// cout<<s<<endl;
// cout<<strcmp(s.c_str(),"END");
while(strcmp(s.c_str(),"ENDOFINPUT"))
{
// cout<<s<<endl;
if(!strcmp(s.c_str(),"START"))
getline(cin,s);
//cout<<s<<endl;
else
{
if(!strcmp(s.c_str(),"END"))
{
getline(cin,s);
}
else
{
v.push_back(s);
getline(cin,s);
}
}
}
for(int i=0;i<v.size();i++)
{
ctp(v[i]);
// cout<<s<<endl;
// cout<<v[i]<<" ";
}
}