#include <stdio.h>
#include <string.h>
#include <windows.h>
int main(int argc, char *argv[])
{
char arr1[] = "I my jay!!!!!!!!!!";
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);
Sleep(1000);//睡眠1秒
system("cls");//清空屏幕
left++;
right--;
}
printf("%s\n", arr2);
return 0;
}
两边向中间打印(C语言)
最新推荐文章于 2024-11-02 14:41:43 发布