Submission #9735

# Submission time Handle Problem Language Result Execution time Memory
9735 2014-09-28T08:31:20 Z shinhj88 Veni, vidi, vici (kriii2_V) C++
0 / 4
0 ms 1676 KB
#include <string>
#include <iostream>
#include <cstdio>
using namespace std;
int n;
char arr[26];
char en(char a,char b)
{
        int t = (int)(a + b - 'a'-'a');
        t %= 26;
        
        return arr[t];
}
int main()
{

        scanf("%d",&n);
        getchar();
        string str;
        getline(cin,str);
        for(int i = 0;i < 26; i++)
        {
                
                int t = i - n + 26 ;
                t %= 26;
                
                arr[i] = (char)t +'a';
        }
        for(int i = 0;i < str.length(); i++)
        {
                if(str[i] == ' ')
                {
                        printf(" ");
                        i++;
                }
                if(i + 1 >= str.length())
                {
                        break;
                }
                if(str[i+1] == ' '){
                        continue;
                }
                printf("%c",en(str[i],str[i + 1]));
                i++;
        }
        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 -