This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <cstring>
int main() {
int n, cnt=0;
char temp[111111], str[103];
scanf("%d", &n);
getchar();
gets(temp);
int j=0;
bool flag = false;
while(temp[cnt] != ' ') {
if(temp[cnt] == '\n') {
flag = true;
break;
}
str[j++] = temp[cnt++];
}
cnt++;
str[j] = '\0';
while(1) {
int len = strlen(str);
for(int i=0; i<len; i++) {
char y = str[i];
i++;
if(i == len) break;
char z = str[i];
char x = y-'a'+z-'a'-n;
if(x >= 26) x %= 26;
while(x<0) {
x+=26;
}
printf("%c", x+'a');
}
if(flag || cnt > strlen(temp)) break;
printf(" ");
int j=0;
while(cnt < strlen(temp) && temp[cnt] != ' ') {
if(temp[cnt] == '\n') {
flag = true;
break;
}
str[j++] = temp[cnt++];
}
cnt++;
str[j] = '\0';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |