我希望你是我独家记忆

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

URAL_1601

Posted on 2008-11-06 17:00 Hero 阅读(86) 评论(0)  编辑 收藏 引用 所属分类: 代码如诗--ACM
 1 // 1601 C++ Accepted 0.015 129 KB URAL
 2 #include <iostream>
 3 #include <string>
 4 #include <algorithm>
 5 
 6 char data[10100] ;
 7 
 8 int main()
 9 {
10     int pdata = -1 ;
11     while( (data[++pdata]=getchar()) != EOF ) ;
12     bool up = true ;
13     forint i=0; i<=pdata; i++ )
14     {
15         if'.'==data[i]||'!'==data[i]||'?'==data[i] ) up = true ;
16         if( data[i]>='A'&&data[i]<='Z' )
17         {
18             if( up )
19             {
20                 up = false ; printf( "%c", data[i] ) ;
21             }
22             else
23             {
24                 printf( "%c", tolower( data[i] ) ) ;
25             }
26         }
27         else
28         {
29             printf( "%c", data[i] ) ;
30         }
31     }
32     return 0 ;
33 }

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