演示多个字符从两端移动,向中间汇聚。
#include<stdio.h>
#include<string.h>
#include<Windows.h>
void ShowString()
{
char src_str[] = "Welcome To Bit Tech...";
char dst_str[] = "######################";
int left = 0;
int right = strlen(src_str)-1;
while (left<=right)
{
dst_str[left] = src_str[left];
dst_str[right] = src_str[right];
printf("%s\r", dst_str);
left++, right--;
Sleep(500);
fflush(stdout);
}
}
int main()
{
ShowString();
system("pause");
return 0;
}