This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
* v.cpp
*
* Created on: 2014. 9. 28.
* Author: minque
*/
#include <iostream>
#include <cstring>
using namespace std;
int main(){
int n, len, i, cnt=0, t=0;
char enc[102];
cin>>n;
while(cin>>enc){
if(cnt++) cout<<' ';
len = strlen(enc);
for(i = 0; i+1 < len; i+=2){
t=(enc[i]-'a' + enc[i+1]-'a' - n);
if(t < 0) t=26+t;
cout<<(char)((t)%26+'a');
}
}
cout<<endl;
return 0;
}
/*Sample
2
ab axcexseg yzkansuqe mlssltqu
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |