标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3269 Accepted Submission(s):
974
1 #include <stdio.h> 2 #include <string.h> 3 int main() 4 { 5 char str[1010]; 6 while(~scanf("%s", str)) 7 { 8 char ch[2] = {‘0‘, ‘0‘}; 9 int i, t, h, total = 0; 10 int len = strlen(str); 11 int num[3] = {0, 0, 0}; 12 int flag = 0; 13 if(len<=2) 14 { 15 printf("Wrong Answer\n"); 16 continue; 17 } 18 for(t=0, h=0, i=0; i<len; i++) 19 { 20 if(str[i] == ‘o‘) 21 total++; 22 if(str[i] != ‘o‘ || i == len-1) 23 { 24 ch[h++] = str[i]; 25 num[t++] += total; 26 total = 0; 27 continue; 28 } 29 } 30 31 // num[t++] = total; 32 if(num[0]*num[1] == num[2] && ch[0]==‘z‘ && ch[1] == ‘j‘ && num[1]!=0) 33 printf("Accepted\n"); 34 else 35 printf("Wrong Answer\n"); 36 } 37 return 0; 38 }
标签:
原文地址:http://www.cnblogs.com/fengshun/p/4677494.html