
答案
设计函数实现将一个字符串中小写字母转化为大写字母。#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);
}
其它答案可根据情况酌情给分