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 <stdio.h>
#include <string.h>
#define L_MAX 101
#define MOD 26
int N, L;
char S[L_MAX+1];
int mod(int num) {
while(num<0) num+=MOD;
while(num>=MOD) num-=MOD;
return num;
}
int main(void) {
int i;
scanf("%d",&N);
while(scanf("%s",S)==1) {
L=strlen(S);
for(i=0 ; i<L ; i++) S[i]-='a';
if(L%2) L--;
for(i=0 ; i<L ; i+=2) printf("%c",mod(S[i]+S[i+1]-N)+'a');
printf(" ");
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |