答案是:
设计函数实现将一个字符串中小写字母转化为大写字母。#include (1分)
#include (1分)
/* 转换函数4分,其中:循环正确1分,判断、转换正确各1分,其余1分 */
void Convert(char * str)
{
while (*str != '\0')
{
if(islower(*str ))
*str = toupper(*str);
str++;
}
}
/* 主函数4分,其中:变量定义初始化正确1分,函数调用正确2分,输出正确1分*/
void main( )
{
char str[] = "123123asadAsadMNer";Convert(str);
printf("%s\n",str);
}
其它答案可根据情况酌情给分
出自
睿学 >
兰州理工大学C语言程序设计a
更多答案联系客服:19139051760
本题添加时间:2023/4/3 12:59:00