作业帮 > 综合 > 作业

c++ 英文字母大小写转换

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/03 21:04:36
c++ 英文字母大小写转换
以下程式码是做英文字亩大小写转换
使用"库存函数"不知哪里出错了
另外
"副程式"也有些问题
麻烦帮我找出错误并修正
#include
#include
#include
void convert(char befor_ch);
int main(void){
char str[80];
gets(str);
printf("原始自符串 => %s\n" ,str);
//错误
printf("使用库存函数-自符串 => %s\n" ,tolower(str));
//错误
convert(str);
system("PAUSE");
return 0;
}
void convert(befor_ch){
if(befor_ch >= 'a' && befor_ch = 'A' && befor_ch
#include
#include
#include
void convert(char * befor_ch);
int main(void)
{
int i;
char str[80];
gets(str);
printf("原始自符串 => %s\n" ,str);
printf("使用库存函数-自符串 =>");
for(i=0;str[i]!='\0';i++)
{
printf("%c" ,tolower(str[i]));
}
printf("\n");
convert(str);
system("PAUSE");
return 0;
}
void convert(char * befor_ch)
{
int i;
printf("使用副程式-自符串 =>");
for(i=0;befor_ch[i]!='\0';i++)
{
if(befor_ch[i] >= 'a' && befor_ch[i] = 'A' && befor_ch[i]