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 <iostream>
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <string.h>
using namespace std;
int main()
{
int n;
char buf[100 * 101 + 1];
scanf("%d ", &n);
gets(buf);
int len = strlen(buf);
char first;
char second;
bool isFirst = true;
string str_ret;
int count = 0;
for (int i = 0; i < len; i++)
{
count++;
if (buf[i] == ' ')
{
str_ret += " ";
count = 0;
isFirst = true;
continue;
}
if (isFirst == true)
{
first = buf[i] - 'a';
isFirst = false;
}
else
{
second = buf[i] - 'a';
isFirst = true;
}
if (count % 2 == 0)
str_ret += (char)((first + second - n + 26) % 26) + 'a';
}
cout << str_ret << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |