C语言 第8章 编程练习
/* 第1题1.设计一个程序,统计在读到文件结尾之前读取的字符数。*/#include <stdio.h>int main(void){ int 字符; int 统计 = 0; printf("请输入一些字符(Ctrl+Z退出):\n"); while((字符 = getchar()) != EOF) // EOF文件结尾 { 统计++; } printf("字符: %d.\n