题目:多个字符从两端移动,向中间汇聚
#define _CRT_SECURE_NO_WARNINGS 1
#pragma warning(disable:6031)
//在VS2022中解决scanf函数返回值被忽略的问题
#include <stdio.h>
int main()
{
char arr1[] = "My name is Huang, when suppressing all enemies of time!";
char arr2[] = "#######################################################";
int left = 0;
int right = strlen(arr1) - 1;
printf("%s\n", arr2);
while (left <= right)
{
Sleep(1000);
arr2[left] = arr1[left];
arr2[right] = arr1[right];
left++;
right--;
printf("%s\n", arr2);
}
}