我希望你是我独家记忆

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

HLOJ_1120

Posted on 2009-03-23 20:04 Hero 阅读(63) 评论(0)  编辑 收藏 引用 所属分类: 代码如诗--ACM
 1 //1120      Accepted     31    196    463     C++ 
 2 
 3 #include <iostream>
 4 #include <string>
 5 using namespace std ;
 6 
 7 int tnum ;
 8 int inn ;
 9 
10 int main()
11 {
12     while( scanf( "%d"&tnum ) != EOF )
13     {
14         while( tnum -- )
15         {
16             scanf( "%d"&inn ) ; char ch = getchar() ;
17             string str ; 
18             int cnt = 0 ;
19             whiletrue )
20             {
21                 cin >> str ; ch = getchar() ;
22                 int len = str.length() ;
23                 if( len == inn ) cnt++ ;
24                 if( ch == '\n' ) break ;
25             }
26 
27             cout << cnt << endl ;
28         }
29     }
30     return 0 ;
31 }

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