用英语写一篇文章。 介绍编程语言的主要类别,并对每种语言进行详细解释。

如题所述

第1个回答  2019-06-13
void main() { char t[3][81];//每行最多80个字符,数组长度要81 int i,j; int u[3],l[3],d[3],s[3],other[3];//按行统计,u-大写,l-小写,d-数字,s-空格,other-其它字符 for(i=0;i<3;i++)//输入每行字符串,并对u、l、d、s、other初始化 { printf("\n%dst row:",i+1); gets(t[i]); u[i]=l[i]=d[i]=s[i]=other[i]=0; } for((i=0;i/统计过程 for(j=0;t[i][j];j++)//每行统计到ascii码0结束 { if(t[i][j]>='a'&&t[i][j]='A'&&t[i][j]='0'&&t[i][j]<='9') d[i]++; else if(t[i][j]==' ') s[i]++; else other[i]++; } for(i=0;i<3;i++)//按行输出统计结果 { printf("\n%dst row:lowercase=%d,uppercase=%d,digit=%d,space=%d,other=%d",i+1,l[i],u[i],d[i],s[i],other[i]); } //按文章输出统计结果 printf("\n\ntotal:lowercase=%d,uppercase=%d,digit=%d,space=%d",other=%d", l[0]+l[1]+l[2],u[0]+u[1]+u[2],d[0]+d[1]+d[2],s[0]+s[1]+s[2],other[0]+other[1]+other[2]); }本回答被网友采纳

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网