编写代码,演示多个字符从两端移动,向中间汇聚。

int  main()
{
	char  arr1[] = "welcome to bit!!!!!!";
	char  arr2[] = "####################";
	int left = 0;
	int right = strlen(arr1) - 1;
	 
	while (left <= right)
	{
		Sleep(1000);
		arr2[left] = arr1[left];
		arr2[right] = arr1[right];
		system("cls");//清屏
		printf("%s\n", arr2);
		left++;
		right--;
	}
	system("pause");
	return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_41892460/article/details/82811607