#include <stdio.h>
#include <string.h>
#include <Windows.h>
#include <stdlib.h>
int main()
{
char arr1[] = "welcome to China!!!";
char arr2[] = "################!!!";
int left = 0;
//int right = sizeof(arr1) / sizeof(arr1[0]) - 2; 字符串末尾隐藏/0 所以要-2
int right = strlen(arr1) - 1; //要引头文件
while (left <= right)
{
arr2[left] = arr1[left];
arr2[right] = arr1[right];
printf("%s\n", arr2);
Sleep(1000); //可以休息 一秒
system("cls"); //执行系统命令的函数-cls-清空屏幕
left++;
right--;
}
return 0;
}
加入Sleep会停顿一秒在打印
加入Sleep会停顿一秒在打印
标签:字符,right,演示,int,汇聚,arr2,arr1,include,left From: https://blog.51cto.com/u_15927947/6007580