#include<stdio.h> #include<string.h> char s[1001]; int main() { int num1,num2,num3; char *p; while(scanf("%s",s)!=EOF) { num1 = num2 = num3 = 0; p = s; if( !strcmp("zoj",s) ) { printf("Accepted "); continue; } while( (*p)=='o' ) { num1++; p++; } if((*p) == 'z'){ p++; while((*p) == 'o'){num2++; p++;} if((*p) == 'j') { p++; while((*p) == 'o') {num3++; p++;} if(!(*p) && num2>0 && num3==num1*num2) {printf("Accepted ");continue;} } } printf("Wrong Answer "); } return 0; } /************************************************************** Problem: 1006 User: kirchhoff Language: C Result: Accepted Time:30 ms Memory:916 kb ****************************************************************/