题目1006:ZOJ问题
实际上能够AC的代码,得到的样例输出却是:
#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
****************************************************************/