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>
char str[11111];
int main()
{
int n;
scanf("%d", &n);
getchar();
gets(str);
char *pch;
pch = strtok(str, " ");
while(pch!=NULL){
char tmp[111];
int len;
sprintf(tmp,"%s", pch);
len = strlen(tmp);
for(int i=0;i<len;i+=2){
if(tmp[i+1] !='\0'){
int ans = (tmp[i]-'a'+tmp[i+1]-'a' - n);
if(ans < 0){
ans+=26;
}
printf("%c", ans%26 + 'a');
}
}
printf(" ");
pch = strtok(NULL, " ");
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |