测试程序1:
#include <stdio.h> int main(void) { char ch; printf("please input an character: "); while((ch = getchar()) != '#') printf("xxx "); return 0; }
测试程序2
#include <stdio.h> int main(void) { char ch; printf("please input an character: "); while((ch = getchar()) != '#') { printf("xxx "); while(ch = getchar() != ' ') // 为什么起作用????? continue; } return 0; }