12、给定程序MODI1.C中函数 fun 的功能是:将tt所指字符串中的小写字母都改为对应的大写字母,其它字符不变。
例如,若输入"Ab, cD",则输出"AB, CD"。
请改正程序中的错误,使它能得出正确的结果。
注意:不要改动 main 函数,不得增行或删行,也不得更改程序的结构!
#include #include char* fun( char tt[] )
{
int i;
for( i = 0; tt[i]; i++ )
/**********found***********/
if(( 'a' <= tt[i] )||( tt[i] <= 'z' ) )
/**********found***********/
tt[i] += 32;
return( tt );
}
main( )
{
char tt[81];
printf( "\nPlease enter a string: " );
gets( tt );
printf( "\nThe result string is:\n%s", fun( tt ) );
}
| 广告合作:400-664-0084 全国热线:400-664-0084 Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号 珠峰网 版权所有 All Rights Reserved
|