不用数组,不知为何是0分

P1914 小书童——凯撒密码

vastian @ 2016-05-28 19:25:58

#include<stdio.h>
int main()
{
    int num;
    char c;
    scanf("%d", &num);
    getchar();
    while (1)
    {
        scanf("%c", &c);
        if (c == '\n')
        {
            printf("\n");//去掉这换行也是错
            break;
        }
        printf("%c", 'a' + (c -'a' + num)%26);        
    }
}

by SAZZM @ 2016-08-16 12:37:14

我也是诶


|