HD1048

题目连接

http://acm.hdu.edu.cn/showproblem.php?pid=1048

The Hardest Problem Ever

 

 1 #include<iostream.h>
2 #include<string.h>
3 int main()
4 {
5 int i, k, n ;
6 char x,c[201], s[20], d[4], h[11]={"ENDOFINPUT"} ;
7 while(cin.getline(c, 200) )
8 {
9 if(strcmp(c,h) == 0)
10 break ;
11 if(strcmp(c,"START")!=0&&strcmp(c,"END")!=0)
12 {
13 k = strlen(c) ;
14 for(i = 0 ; i < k ; i++)
15 {
16 if(c[i]<='E'&&c[i]>='A')
17 {
18 x = c[i]+21 ;
19 cout<< x ;
20 }
21 else
22 if(c[i]<='Z'&&c[i]>='F')
23 {
24 x = c[i]-5 ;
25 cout<< x ;
26 }
27 else
28 cout<<c[i] ;
29 }
30 cout<<endl ;
31 }
32
33 }
34 return 0 ;
35 }

 

你可能感兴趣的:(HD1048)