|
|
back to boardMaybe somebody can explain me, why i received WA3. Posted by LaE 3 Aug 2006 13:45 Everything seems to be Ok, but wa3! Josepth algo works correctly (to my mind). Maybe i must skip not only '\n', but something else. Here is source: #include<stdio.h> char str[30010]; int len=0; int main() { while(!feof(stdin)) { scanf("%c",&str[len]); if(str[len]!='\n')len++; } int res=0; for(int i=1;i<=len-1;i++) res=(res+1999)%i; if(str[res]=='?') printf("Yes"); else { if(str[res]==' ') printf("No"); else printf("No comments"); } return 0; } |
|
|