我希望你是我独家记忆

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

HLOJ_1127

Posted on 2009-03-25 17:01 Hero 阅读(80) 评论(0)  编辑 收藏 引用 所属分类: 代码如诗--ACM
 1 //1127      Accepted     15    192    582     C++ 
 2 #include <iostream>
 3 #include <string>
 4 #include <algorithm>
 5 
 6 using namespace std ;
 7 
 8 string str ;
 9 char ch ;
10 int tnum ;
11 
12 int main()
13 {
14     while( cin >> tnum )
15     {
16         getchar() ;
17         while( tnum -- ) 
18         {
19             cin >> str ; getchar() ; //cout << str << endl ;
20             cin >> ch ;  getchar() ; //cout << ch  << endl ;
21 
22             string out ;
23             string::iterator iter ;
24             for( iter=str.begin(); iter!=str.end(); iter++ )
25             {
26                 if*iter != ch ) out += *iter ;
27             }
28 
29             ifout.empty() )
30                 cout << "NULL" << endl ;
31             else
32                 cout << out << endl ;
33         }
34     }
35 
36     return 0 ;
37 }

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