我希望你是我独家记忆

一段永远封存的记忆,随风而去
posts - 263, comments - 31, trackbacks - 0, articles - 3
   :: 首页 :: 新随笔 ::  :: 聚合  :: 管理

HLOJ_1300

Posted on 2009-07-31 13:00 Hero 阅读(125) 评论(0)  编辑 收藏 引用 所属分类: 代码如诗--ACM

 

 1 //1300  Accepted  0 196 467 C++  
 2 #include <iostream>
 3 #include <string>
 4 using namespace std ;
 5 
 6 int tnum ;
 7 string instr ;
 8 
 9 int main()
10 {
11     while( cin >> tnum )
12     {
13         forint ctnum=1; ctnum<=tnum; ctnum++ )
14         {
15             cin >> instr ;
16             string::iterator posi = instr.begin() ;
17             for( ; posi!=instr.end(); posi++ )
18             {
19                 *posi = (*posi) + 1 ;
20                 if*posi > 'Z' ) *posi = 'A' ;
21             }
22 
23             cout << "String #" << ctnum << endl ;
24             cout << instr << endl << endl ;
25         }
26     }
27     return 0 ;
28 }

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理