Submission #9299

#TimeUsernameProblemLanguageResultExecution timeMemory
9299shashackVeni, vidi, vici (kriii2_V)C++14
0 / 4
0 ms1676 KiB
#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; } else if(start+1 == len) break; else if( start+1 < len && 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...