posts - 17,  comments - 0,  trackbacks - 0
 1 #include <cstdlib>
 2 #include <iostream>
 3 using namespace std;
 4 
 5 
 6 int main(int argc, char *argv[])
 7 {
 8     int n,i,j,k; 
 9     char str[100], a[] = "CUGB";
10 
11     scanf("%d",&n); 
12     for(i=1;i<=n;i++
13     { 
14         memset(str,0,sizeof(str));
15         scanf("%s",str);
16         j=0;k=0;
17         while(str[j]!='\0')
18         {
19             if((str[j]==a[k])&&(a[k]!='\0'))
20             {
21                 k++;
22             }
23             j++;
24             
25         } 
26         if((a[k]=='\0')&&(j>4))
27         {    
28             cout<<"Case "<<i<<": Yes"<<endl;             
29         }
30         else
31             cout<<"Case "<<i<<": No"<<endl;
32     } 
33 
34     system("PAUSE");
35     return EXIT_SUCCESS;
36 }
37 
posted on 2011-11-08 22:36 刘聪 阅读(135) 评论(0)  编辑 收藏 引用

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



<2011年11月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

常用链接

留言簿(4)

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜