<C Primer Plus>9 Introducing getchar() and putchar()

 1 #include <stdio.h>
 2 #include <math.h>
 3 #define    SPACE ' '
 4 int main(void){
 5     char ch;
 6 
 7     while ((ch = getchar()) != '
'){
 8         if (ch == SPACE){
 9             putchar(ch);
10         }
11         else{
12             putchar(ch + 1);
13         }
14     }
15     //putchar(ch);
16 
17     return 0;
18 }

REMEBER 

It demonstates a characteristic C programming style----combing two actions in one expression.

原文地址:https://www.cnblogs.com/michael2016/p/6661489.html