C语言if语句 getchar putchar C语言if语句实例 C语言ctype函数实例 02 C语言if语句 getchar putchar // cypher1.c -- alters input, preserving spaces #include <stdio.h> #define SPACE ' ' // that's quote-space-quote int main(void) { char ch; ch = getchar(); // read a character while (ch != '\n') // while not end of line { if (ch == SPACE) // leave the space putchar(ch); // character unchanged else putchar(ch + 1); // change other characters ch = getchar(); // get next character } putchar(ch); // print the newline return 0; } C语言if语句实例 C语言ctype函数实例