C语言:从两端滚动输出

2023-12-17 04:52:23

?


#include<stdio.h>
#include<string.h>
#include<windows.h>
#include<stdlib.h>
int main()
{
	char arr1[] = "happy every day!!!";
	char arr2[] = "                  ";
	int left = 0;
	int right = strlen(arr1) - 1;
	while (left <= right)
	{
		arr2[left] = arr1[left];
		arr2[right] = arr1[right];
		left++;
		right--;
		Sleep(300);
		system("cls");
		printf("%s", arr2);
	}
	return 0;
}

文章来源:https://blog.csdn.net/2301_80727984/article/details/134959729
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。