level 1
木泓桑
楼主
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
char str1[101]={0},str2[51]={0};
char *p1,*p2=str2;
printf("请输入第一个字符串:");
scanf("%s",str1);
printf("请输入第二个字符串:");
scanf("%s",str2);
p1=&str1[strlen(str1)];
while(p2!=NULL)
{
*(p1)=*(p2);
p1++;p2++;
}
*(p1)='\0';
printf("%s",str1);
getch();
}
2011年05月02日 12点05分
1
#include<string.h>
#include<stdlib.h>
int main()
{
char str1[101]={0},str2[51]={0};
char *p1,*p2=str2;
printf("请输入第一个字符串:");
scanf("%s",str1);
printf("请输入第二个字符串:");
scanf("%s",str2);
p1=&str1[strlen(str1)];
while(p2!=NULL)
{
*(p1)=*(p2);
p1++;p2++;
}
*(p1)='\0';
printf("%s",str1);
getch();
}