Submission #9702

#TimeUsernameProblemLanguageResultExecution timeMemory
9702dominyellowVeni, vidi, vici (kriii2_V)C++98
1 / 4
0 ms1676 KiB
#include <stdio.h> #include <iostream> #include <string> #include <map> #include <queue> #include <set> #include <vector> using namespace std; int main(void){ int n; scanf("%d", &n); string tmp_str; cin>>tmp_str; char input_str[2000]; gets(input_str); string full_str = tmp_str + input_str; while(true){ if(full_str.length() <= 1){ break; } if(full_str[1] == ' '){ printf(" "); full_str = full_str.substr(2); continue; } if(full_str[0] == ' '){ printf(" "); full_str = full_str.substr(1); continue; } int first, end; first = full_str[0] - 'a'; end = full_str[1] - 'a'; int modu = (first+end-n); if(modu < 0){ modu += 26; } modu = modu%26; printf("%c", 'a'+modu); full_str = full_str.substr(2); } printf("\n"); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...