码迷,mamicode.com
首页 > 其他好文 > 详细

HDU 1048 - The Hardest Problem Ever

时间:2016-05-03 22:08:14      阅读:281      评论:0      收藏:0      [点我收藏+]

标签:

让你改一改字符

 1 #include <iostream>
 2 #include <cstdio>
 3 #include <cstring>
 4 using namespace std;
 5 char s[105];
 6 const char list[]={‘V‘,‘W‘,‘X‘,‘Y‘,‘Z‘,‘A‘,‘B‘,‘C‘,‘D‘,‘E‘,‘F‘,‘G‘
 7                     ,‘H‘,‘I‘,‘J‘,‘K‘,‘L‘,‘M‘,‘N‘,‘O‘,‘P‘,‘Q‘,‘R‘,‘S‘
 8                     ,‘T‘,‘U‘};
 9 int main()
10 {
11     while(gets(s))
12     {
13         if(strcmp(s,"ENDOFINPUT")==0) break;
14         while(gets(s))
15         {
16             if(strcmp(s,"END")==0) break;
17             for(int i=0;s[i]!=‘\0‘;i++)
18             {
19                 if(s[i]<=‘Z‘&&s[i]>=‘A‘) cout<<list[s[i]-‘A‘];
20                 else cout<<s[i];
21             }
22             cout<<endl;
23         }
24     }
25 } 

 

HDU 1048 - The Hardest Problem Ever

标签:

原文地址:http://www.cnblogs.com/nicetomeetu/p/5456627.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!