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
刘聪 阅读(147)
评论(0) 编辑 收藏 引用