为帮助准备参加计算机等级考试的考生,能够在备考复习阶段里,查缺补漏,巩固知识点。下面唯学小编特整理了计算机等级考试二级C语言上级模拟试题,望准备参加计算机等级考试的考生能够认真练习,争取顺利通过计算机等级考试!具体试题内容如下:
填空题
请补充fun函数,该函数的功能是字符串tt中的大写字母都改为对应的小写字母,其它字符不变.
例如,若输入"Are you come from Sichuan?则输出","are you come from sichuan?"
注意:部分源程序给出如下。
仅在横线上填入所编写的若干表达式或语句,勿改动函数中的其他任何内容。
试题程序:#include
#include
#include
char *fun(char tt[])
{
int i;
for(i=0;tt[i];i++)
{
if((tt[i]>='A')&&(___1___))
tt[i] += ___2___;
}
return (___3___);
}
main()
{
char tt[81];
printf("\nPlease enter a string: ");
gets(tt);
printf("\nThe result string is: \n%s", fun(tt));
}
第1处填空:tt[i]<=’z’或’z’>=tt[i]
第2处填空:32或’a’-‘A’
第3处填空:tt