Submission #9276

# Submission time Handle Problem Language Result Execution time Memory
9276 2014-09-28T05:18:57 Z shashack Veni, vidi, vici (kriii2_V) C++14
0 / 4
0 ms 1676 KB
#include <iostream>
#include <string>
using namespace std;

int main(){
//	freopen("input.txt", "r", stdin);
	string input;
	int n; scanf("%d", &n);getchar();
	getline(cin, input);

	int start=0, len=input.size();
	
	while(start != len){
		if(input[start] == ' '){
			printf(" ");
			start+=1;
		}
		if(input[start+1] == ' '){
			printf(" ");
			start+=2;
		}
		else{
			int a=input[start]-97;
			int b=input[start+1]-97;
			int c=(a+b+26-n)%26;

			printf("%c", 'a'+c);
		//	printf("%c", 97+a);
			start+=2;
		}
	}
	printf("\n");
	return 0;
}
# 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 -