Submission #9575

# Submission time Handle Problem Language Result Execution time Memory
9575 2014-09-28T07:22:27 Z roott76 Veni, vidi, vici (kriii2_V) C++
0 / 4
0 ms 1676 KB
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	getchar();
	char in[100200];
	gets(in);

	int len = strlen(in), bp = 0;
	in[len] = ' ';
	in[len+1] = NULL;
	len++;

	for(int i=0; i<len; i++)
	{
		if(in[i] != ' ') in[i] -= 'a';
	}

	for(int i=0; i<len; i+=2)
	{
		if(i == len-1 || i == len-2) break;
		if(in[i] == ' ')
		{
			i--;
			cout << " ";
		}
		else if(in[i+1] == ' ') cout << " ";
		else cout << char((in[i]+in[i+1]-n)%26 + 'a');
	}
	cout << endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1676 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -