C语言程序设计第五版谭浩强课后答案 第五章习题答案,第五章1.请画出例5.6中给出的3个程序段的流程图流程图1:流程图2:流程图3:2.请补充例5.7程序,分别统计当“fa
#include<stdio.h>intmain(){charc;//定义eng_char为英文字母的个数,初始值为0//定义space_char为空格字符的个数,初始值为0//定义digit_char为数字字符的个数,初始值为0//定义other_char为其他字符的个数,初始值为0inteng_char =0, space_char =0, digit_char =0, other_char =0;printf("请输入一...
int english = 0, space = 0, number = 0, other = 0; while ((c = getchar()) != '\n') { if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'z') english++; else if (c == ' ') space++; else if (c >= '0' && c <= '9') number++; else other++; } p...