下列给定程序中,函数fun()的作用是:将字符串tt中的小写字母都改为对应的大写字母,其他字符不变。例如,若输入“edS,dAd”,则输出“EDS,DAD”。
请改正程序中的错误,使它能得到正确结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。
试题程序:
#include <stdio.h>
#include <string.h>
#include <conio.h>
/*************found*************/
char fun(char tt[ ])
int i;
for(i=0;tt[i];i++)
/*************found*************/
if((tt[i]>=’A’)&&(tt[i]<=’Z’))
tt[i]-=32;
return(tt);
main()
int i;
char tt[81];
clrscr();
printf("\nPlease enter a string:");
gets(tt);
printf("\nThe result string is:/n%s",fun(tt));