cypher2.c

来自「经典书籍:C Primer Plus(第五版)中文版和源代码 本书全面讲述了C」· C语言 代码 · 共 19 行

C
19
字号
// cypher2.c -- alters input, preserving non-letters
#include <stdio.h>
#include <ctype.h>            // for isalpha()
int main(void)
{
    char ch;

    while ((ch = getchar()) != '\n')
    {
        if (isalpha(ch))      // if a letter,
            putchar(ch + 1);  // change it
        else                  // otherwise,
            putchar(ch);      // print as is
    }
    putchar(ch);              // print the newline
   
    return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?