运算不完全#include"stdio.h" main() { char a[20],b[20],*p1,*p2; p1=a; p2=b; printf("输入a\n"); gets(#include"stdio.h"main(){char a[20],b[20],*p1,*p2;p1=a;p2=b;printf("输入a\n");gets(a);while(*p1!='\0'){ if(*p1'A')*p1=*p1+32;else if(*p1'a')*p1
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/25 01:48:33
运算不完全#include"stdio.h" main() { char a[20],b[20],*p1,*p2; p1=a; p2=b; printf("输入a\n"); gets(#include"stdio.h"main(){char a[20],b[20],*p1,*p2;p1=a;p2=b;printf("输入a\n");gets(a);while(*p1!='\0'){ if(*p1'A')*p1=*p1+32;else if(*p1'a')*p1
运算不完全#include"stdio.h" main() { char a[20],b[20],*p1,*p2; p1=a; p2=b; printf("输入a\n"); gets(
#include"stdio.h"
main()
{
char a[20],b[20],*p1,*p2;
p1=a;
p2=b;
printf("输入a\n");
gets(a);
while(*p1!='\0')
{
if(*p1'A')
*p1=*p1+32;
else if(*p1'a')
*p1=*p1-32;
*p1++;
}
printf("大小写变化后=%s\n",a);
while(*p1!='\n')
{
*p1=*p2;
p1++;
p2++;
}
*p2='\0';
p2=b;
printf("原数组=%s\n第二数组=%s",p1,p2);
while(*p2!='\n')
p2++;
while(*p1!='\n')
{
*p1=*p2;
p1++;
p2++;
}
*p2='\n';
p2=b;p1=a;
printf("连接后数组=%s\n第二个数组=%s\n",p1,p2);
}
运算不完全#include"stdio.h" main() { char a[20],b[20],*p1,*p2; p1=a; p2=b; printf("输入a\n"); gets(#include"stdio.h"main(){char a[20],b[20],*p1,*p2;p1=a;p2=b;printf("输入a\n");gets(a);while(*p1!='\0'){ if(*p1'A')*p1=*p1+32;else if(*p1'a')*p1
#include"stdio.h"
void main()
{
char a[20],b[20],*p1,*p2;
p1=a;
p2=b;
printf("输入a\n");
gets(a);
while(*p1!='\0')
{
if(*p1'A')
*p1=*p1+32;
else if(*p1'a')
*p1=*p1-32;
*p1++;
}
printf("大小写变化后=%s\n",a);
printf("\n");
p1=a;
//while(*p1!='\n')
while(*p1!='\0')
{
*p2=*p1;
p1++;
p2++;
}
*p2='\0';
printf("原数组=%s\n第二数组=%s\n",a,b);
printf("\n");
//while(*p2!='\n')
while(*p1!='\0')
p1++;
p2=b;
//while(*p2!='\n')
while(*p2!='\0')
{
*p1=*p2;
p1++;
p2++;
}
//*p2='\n';
*p1='\0';
p2=b;
p1=a;
printf("连接后数组=%s\n第二个数组=%s\n",p1,p2);
}
输出
输入a
TYUiop
大小写变化后=tyuIOP
原数组=tyuIOP
第二数组=tyuIOP
连接后数组=tyuIOPtyuIOP
第二个数组=tyuIOP