#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
int result;
char alpha[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
string a;
scanf("%d", &n);
getc(stdin);
getline(cin, a);
for(int i = 0 ; i < a.length()+1 ; i+=2){
result = 0;
if(a.length()-1 < i+1) break;
if(a[i] == ' '){i++;printf(" ");}
else if(a[i+1] == ' '){printf(" ");continue;}
for(int j = 0 ; j < 26; j++){
if(a[i] == alpha[j]) result += j;
if(a[i+1] == alpha[j]) result += j;
}
result-= n;
while(result < 0){result += 26;}
printf("%c",result%26 + 97);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1676 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |