译密码-while()结构

2024-02-02 20:26:05 浏览数 (2)

代码语言:javascript复制
#include <stdio.h>

int main() {
    char c;
    while ((c = getchar()) != 'n') {
        if ((c >= 'a' && c <= 'z')
                || (c >= 'A' && c <= 'Z')) {
            c = c   4;
            if (c > 'Z' && c <= 'Z'   4 || c > 'z')
                c = c - 22;
        }
        printf("%c", c);
    }
    printf("n");
    return 0;
}

0 人点赞