//welcome to hubei
//$$$$$$$$$$$$$$
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
//演示多个字符从两端移动,像中间汇聚
//welcome to hubei
//$$$$$$$$$$$$$$$$
int main()
{
char arr1[] = "welcome to hubei";
char arr2[] = "$$$$$$$$$$$$$$$$";
int left = 0;
int right = strlen(arr1)- 1;
while (left <= right)
{
arr2[left] = arr1[left];
arr2[right] = arr1[right];
printf("%s\n", arr2);
left++;
right--;
}
return 0;
}
![](https://i-blog.csdnimg.cn/blog_migrate/69c182a42f1abe51c4b11be2c54d14e0.png)