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 }

 

转载于:https://www.cnblogs.com/shangyu/archive/2012/02/04/2337974.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值