Submission #9305

# Submission time Handle Problem Language Result Execution time Memory
9305 2014-09-28T05:29:27 Z shinhj88 Veni, vidi, vici (kriii2_V) C++
0 / 4
0 ms 1676 KB
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
string arr;
int n;
char en(int a,int b)
{
        a += b;
        a -= n;
        a %= 26;
        a += (int)'a';
        return (char)a;
}
int main()
{
        scanf("%d\n",&n);
        getline(cin,arr);
        char a ='a',b = 'x';
        for(int i = 0;i < arr.length(); i+=2)
        {
                if(arr[i+1] == ' '){
                        printf(" ");
                        continue;
                }

                char a = en((int)(arr[i] - 'a'),(int)(arr[i+1] - 'a'));
                printf("%c",a);
                if(arr[i + 2] == ' '){
                        printf(" ");
                        i++;
                }


        }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1676 KB Output is correct
2 Correct 0 ms 1676 KB Output is correct
3 Correct 0 ms 1676 KB Output is correct
4 Correct 0 ms 1676 KB Output is correct
5 Correct 0 ms 1676 KB Output is correct
6 Correct 0 ms 1676 KB Output is correct
7 Incorrect 0 ms 1676 KB Output isn't correct
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -