九度OJ 1006 ZOJ问题 (这题測试数据有问题)
#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\n"); 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\n");continue;}
            }
        }
        printf("Wrong Answer\n");
    }
    return 0;
}
 
/**************************************************************
    Problem: 1006
    User: kirchhoff
    Language: C
    Result: Accepted
    Time:30 ms
    Memory:916 kb
****************************************************************/
 
                    
                     
                    
                 
                    
                
 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号