题目内容:
请补充函数proc(),该函数的功能是将字符串str中的大写字母都改为对应的小写字母,其他字符不变。例如,若输入“How Are You?”,则输出“how are you?”。 注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的横线上填入所编写的若干表达式或语句。
试题程序:
#inelude<stdio.h>
#include<string.h>
#include<conio.h>
Char*proc(char str[])
{
int i;
for(i=0;str[i];i++)
{
if((str[i]>='A')&&( 【1】))
【2】 ;
}
return(【3】);
}
void main()
{
char str[8l];
printf("\nPlease t nter a string:");
gets(str);
printf("\nThe result string is:\n%s",
proc(str));
}
参考答案:
答案解析: