网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

以下程序统计从终端输入的字符中大写字母的个数 ,num[0] 中统计字母 A 的个数 ,num[1] 中统计字母的个数 , 其它依次类推 . 用 # 号结束输入 , 请填空 .

#include <stdio.h>

#include <ctype.h>

main()

{ int num[26]={0},i; char c;

while(( _[16]_______ )!='#')

if(isupper(c)) num[c- ' A ' ]+= _[17]_______ ;

for(i=0;i<26;i++)

Printf("%c:%d\n",i+'A',num[i]);

}


参考答案

更多 “ 以下程序统计从终端输入的字符中大写字母的个数 ,num[0] 中统计字母 A 的个数 ,num[1] 中统计字母的个数 , 其它依次类推 . 用 # 号结束输入 , 请填空 .#include stdio.h#include ctype.hmain(){ int num[26]={0},i; char c;while(( _[16]_______ )!='#')if(isupper(c)) num[c- ' A ' ]+= _[17]_______ ;for(i=0;i26;i++)Printf("%c:%d\n",i+'A',num[i]);} ” 相关考题
考题 str是全部由小写字母字符和空格字符组成的字符串,由 num传入字符串的长度。请补充函数fun(),该函数的功能是:统计字符串str中的单词个数,结果由变量num传回。每个单词之间都由空格隔开,并且字符串str开始不存在空格。例如:str=“how do you do”,结果为:num=4。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。试题程序:include <stdio.h>define N 80void fun(char *s,int *num){int i,n=0;for(i=0;【 】;i++){if(s[i]>='a',s[i]<='z',(s[i+1)==’’||s[i+1]=='\0'))【 】;}【 】;}main(){char str[N];int num=0;printf("Enter a string:\n");gets(str);while(str[num])num++;fun(str,num);printf("The number of word is:%d\n\n",num);

考题 下面程序的功能是()。include include using namespace std;int main (){ in 下面程序的功能是( )。 #include <iostream> #include <string> using namespace std; int main () { int i=1, n=0; char s[80],*p; p=s; strcpy(p,"It is a book.."); for (; *p !=' \0' ;p++) { if(*p=='') i=0; else if (i==0) { n++; i=1; } } cout<<"n=" <<n<<end1; return 0; }A.统计字符串中的单词个数B.统计字符串中的空格个数C.统计字符串中的字母个数D.统计字符串中的全部字符个数

考题 以下程序统计从终端输入的字符中大写字母的个数。用号作为输入结束标志,请填空。

考题 以下程序统计从终端输入的字符中大写字母的个数,num[0]中统计字母A的个数,num[1]中统计字母B的个数,其它依次类推.用#号结束输入,请填空.#include stdio.h#include ctype.hmain(){ int num[26]={0},i; char c;while((_[16]_______)!='#')if(isupper(c)) num[c-‘A’]+= _[17]_______;for(i=0;i26;i++)Printf("%c:%d\n",i+'A',num[i]);}

考题 下面程序的功能是从键盘输入一组字符,从中统计大写字母和小写字母的个数,选择() 填空。 main () { int m=0,n=0; char c; while ((选项 ) != ’n’) { if (c>=’A’ c<=’Z’) m++; if (c>=’a’ c<=’z’) n++; } }A.c=getchar()B.getchar()C.c==getchar()D.scanf(“%c”,c)

考题 下面程序的功能是从键盘输入的一组字符中统计出大写字母的个数m和小写字母的个数n, 并输出m、n中的较大者,请选择填空: int m=0,n=0; char c; while((__)!='n') { if(c>='A' c<='Z') m++ ; if(c>='a' c<='z') n++; } printf("%dn",m)A.scanf("%d",c)B.getchar()C.c=getchar()D.scanf("%c",c)

考题 从键盘输入字符串,统计其中大写字母、小写字母、数字和其他字符出现的个数。

考题 37、下面程序的功能是从键盘输入的一组字符中统计出大写字母的个数m和小写字母的个数n, 并输出m、n中的较大者,请选择填空: int m=0,n=0; char c; while((__)!='\n') { if(c>='A' c<='Z') m++ ; if(c>='a' c<='z') n++; } printf("%d\n",m)A.scanf("%d",c)B.getchar()C.c=getchar()D.scanf("%c",c)

考题 4、下面程序的功能是从键盘输入一组字符,从中统计大写字母和小写字母的个数,选择()填空 main () { int m=0,n=0; char c; while ((【 】) ! =’\n’) { if (c>=’A’ c<=’Z’) m++; if (c>=’a’ c<=’z’) n++; } }A.c=getchar()B.c==getchar()C.getchar()D.scanf(“%c”,c)