单项选择题
设有如下程序: #include"stdio.h" main() { char c; int m=0,n=0; while((c=getchar())!=’\n’) {if(c>=’A’&&c<=’Z’) m++; else if(c>=’a’&&c<=’z’)n++;} printf("m=%d,n=%d",m,n);} 如果从键盘上输入:AbCdefGHj<回车>,则程序运行后的输出结果是 ( )
A.m=5,n=4
B.m=4,n=5
C.m=9,n=0
D.无确定值
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
以下程序 #include<string.h> main() { char a1[80],a2[80],*s1=a1,*s2=a2; gets(s1);gets(s2) if(!strcmp(s1,s2))printf( * ); else printf( # ); printf( %d n ,strlen(strcat(s1,s2))); } 如果从键盘上输入: book<回车> book<空格><回车> 则输出结果是 ( )
A.*8
B.#9
C.#6
D.*9
点击查看答案
单项选择题
以下关于宏的叙述中正确的是 ( )
A.宏名必须用大写字母表示
B.宏替换时要进行语法检查
C.宏替换不占用运行时间
D.宏定义中不允许引用已有的宏名
点击查看答案
相关试题
下面程序的功能是求整数m、n的最大公约数,...
下面程序的功能是两个整数进行交换,请填空...
函数fun的功能是使一个字符串按逆序存放。...
选择程序中的输入输出语句,以满足题目给定...
若输入字符串:abcde<回车>,则以下while...