zoj ozojo ozoojoo oozoojoooo zooj ozojo oooozojo zojoooo
Accepted Accepted Accepted Accepted Accepted Accepted Wrong Answer Wrong Answer
#include<stdio.h> #include<string.h> char a[1010]; int main() { int count1,count2,count3; while(~scanf("%s",a)) { count1=count2=count3=0; int i,len=strlen(a); int flag=0; int cnt=0; for(i=0;i<len;++i) { if(flag==0) { if(a[i]=='o') { count1++; continue; } else if(a[i]=='z') { flag++; continue; } else if(a[i]=='j') { cnt=1; break; } } if(flag==1) { if(a[i]=='o') { count2++; continue; } else if(a[i]=='j') { flag++; continue; } else if(a[i]=='z') { cnt=1; break; } } if(flag==2) { if(a[i]=='o') { count3++; continue; } else if(a[i]!='o') { cnt=1; break; } } } if(!cnt) { if(flag==2&&count1*count2==count3&&count2) printf("Accepted\n"); else printf("Wrong Answer\n"); } else printf("Wrong Answer\n"); } return 0; }
原文地址:http://blog.csdn.net/ice_alone/article/details/41844967