VScode上可以,提交全WA,看不出哪里有问题,求助欸~
查看原帖
VScode上可以,提交全WA,看不出哪里有问题,求助欸~
1105110
iponika楼主2023/10/8 22:53
#include<stdio.h>
#include<stdlib.h>
//97a~122z
int main(void)
{
    int n, i = 0;
    char str[50] = {0};
    scanf("%d", &n);
    getchar();
    gets(str);
    //while((str[i] = getchar()) != EOF)
    //    ++i;
    str[i] = 0;
    for(i = 0; str[i] != 0; ++i)
        str[i] = (str[i] + n - 97) % 26 + 97;
    printf("%s", str);
    system("pause");
    return 0;
}
2023/10/8 22:53
加载中...