当前位置: > c++ 英文字母大小写转换...
题目
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

提问时间:2020-11-02

答案
#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]
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.