文章
145
粉丝
217
获赞
21
访问
84.3k
#include <stdio.h>
#include <string.h>
void MergeString(char s[],char s1[],char s2[])
{
int i = 0;
char *p,*q;
p = s1;
q = s2;
while(*q != '\0') q++;
q--;
while(*p != '\0' || *q != '\0')
if(i % 2 == 0) s[i++] = *p++;
else s[i++] = *q--;
s[i] = '\0';
}
int main()
{
char s1[101],s2[101];
while(gets(s1) != NULL)
{
gets(s2);
char s[202];
MergeString(s,s1,s2);
puts(s);
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发