|
|
вернуться в форумОбщий форумWA 1404 Послано Mishex 22 фев 2008 03:10 Hi, please, tell me Why do my task solve number 1404 take WA#1: #include <stdio.h> char Change(char ch); int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "rt", stdin); freopen("output.txt", "wt", stdout); #endif char ch; scanf("%c", &ch); while (!feof(stdin)) { ch=ch-'a'; printf("%c", Change(ch)+'a'); scanf("%c", &ch); } return 0; } char Change(char ch) { static int s=5; int ch_res=ch-s; while (ch_res<0) { ch_res+=26; } s+=ch_res; return ch_res; } Re: WA 1404 Послано Mishex 24 фев 2008 14:28 This program output: "secret" on first test from task's condition, but take WA#1 |
|
|