标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3292 Accepted Submission(s): 984
1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 char a[1020]; 6 while(gets(a)) 7 { 8 int i,len,s,b,cot1=0,cot2=0; 9 len=strlen(a); 10 for(i=0;i<len;i++) 11 { 12 if(a[i]==‘z‘) 13 { 14 s=i; 15 // cot1++;//本以为要判断z和j的个数,想复杂了 16 } 17 if(a[i]==‘j‘) 18 { 19 b=i; 20 break;//找到j直接跳出 21 // cot2++; 22 } 23 } 24 if(s*(b-s-1)==(len-b-1)&&(b-s-1)>0)//&&cot1==1&&cot2==1) 25 printf("Accepted\n"); 26 else 27 printf("Wrong Answer\n"); 28 } 29 return 0; 30 }
标签:
原文地址:http://www.cnblogs.com/Eric-keke/p/4690992.html