Submission #9660

# Submission time Handle Problem Language Result Execution time Memory
9660 2014-09-28T07:56:49 Z YesUjam Veni, vidi, vici (kriii2_V) C++
0 / 4
0 ms 1196 KB
#include<cstdio>
#include<cstring>

char str[111111];

int main()
{
	int n;
	scanf("%d", &n);
	getchar();
	gets(str);

	char *pch;
	pch = strtok(str, " ");
	while(pch!=NULL){
		char tmp[1111];
		int len;
		sprintf(tmp,"%s", pch);
		len = strlen(tmp);
		for(int i=0;i<len;i+=2){
			if(tmp[i+1] !='\0'){
				int ans = ((tmp[i]-'a'+tmp[i+1]-'a' - n) + 26)%26;
				printf("%c", ans%26 + 'a');
			}
		}
		pch = strtok(NULL, " ");
		if(pch!=NULL)
			printf(" ");
	}
	printf("\n");
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1196 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -