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 <string>
#include <iostream>
#include <cstdio>
using namespace std;
int n;
char en(char a,char b)
{
int t = (int)(a+ b - 'a'-'a') + 26 - n;
t %= 26;
return (char)t + 'a';
}
int main()
{
scanf("%d",&n);
getchar();
string str;
getline(cin,str);
for(int i = 0;i < str.length(); i++)
{
if(str[i] == ' ')
{
printf(" ");
i++;
}
if(i + 1 >= str.length())
{
printf(" ");
break;
}
if(str[i+1] == ' '){
continue;
}
printf("%c",en(str[i],str[i + 1]));
i++;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |