标签:style blog color strong io for
zoj ozojo ozoojoo oozoojoooo zooj ozojo oooozojo zojoooo
Accepted Accepted Accepted Accepted Accepted Accepted Wrong Answer Wrong Answer
-----------------------------------------------------
思路:
-----------------------------------------------------
1 #include<stdio.h> 2 #include<string.h> 3 char l0[1001]; 4 int main(int argc, char const *argv[]) 5 { 6 int i,a,b,c; 7 int nz,nj; 8 int flag; 9 while(scanf("%s",l0)!=EOF) 10 { 11 nz=nj=flag=0; 12 for(i=0;l0[i]!=‘\0‘;i++) 13 { 14 if(l0[i]==‘z‘) 15 { 16 nz++; 17 a=i; 18 } 19 else if(l0[i]==‘j‘) 20 { 21 nj++; 22 b=i; 23 } 24 else if(l0[i]!=‘o‘) 25 flag=1; 26 else 27 continue; } 28 if(nz!=1||nj!=1||flag)//判断输入是否正确 29 puts("Wrong Answer"); 30 else 31 { 32 c=strlen(l0)-b-1;b=b-a-1;//假定z在j前面 33 if(c==a*b&&b!=0)//a等于c的b,并且b!=0 34 puts("Accepted"); 35 else 36 puts("Wrong Answer"); 37 } 38 } 39 return 0; 40 }
--------------------------------------------------------
小结:
标签:style blog color strong io for
原文地址:http://www.cnblogs.com/qq1029579233/p/3859888.html