|
|
вернуться в форумWhy WA#1?? #include <cstdio> int n,m,i,l,t[201]; char s[201]; int main() { scanf("%s",s); n=0; while(s[n])t[n]=s[n++]-'a'; m=5; for(i=0;i<n;i++) { l=(26+t[i]-m)%26; printf("%c",97+l); m=t[i]; } printf("\n"); return 0; } Edited by author 11.04.2008 23:51 Re: Why WA#1?? don't use namespace std here! And you will get Ac! Re: Why WA#1?? sorry but still WA#1 Re: Why WA#1?? try avoiding \n in the end. At least my AC doesn't. Re: Why WA#1?? Послано Anton 16 ноя 2011 20:17 Have you fixed WA1 ? Re: Why WA#1?? Послано Anton 16 ноя 2011 20:29 I've go AC. WA#1 took place, cause there is some trash in input. It's very very not fear for admins/judges not to warn about it in problem statement ! WA#1 Got AC with reading a string, and WA#1 with symbol reading (commented block), but both ways of reading work correctly on my computer. It seems that input consists EOL symbol '\n'. int main() {
char c; int n=0; char sym[101]; int code[101];
scanf("%s",sym); n=strlen(sym); for (int i=0;i<n;i++) code[i]=sym[i]-0x61;
/* while (scanf("%c",&c)!=EOF) { code[n]=c-0x61; n++; } */ ... |
|
|