#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 |
1 |
Runtime error |
0 ms |
1084 KB |
SIGSEGV Segmentation fault |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |