#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<windows.h>
int main()
{
char a[]="hello word!";
char b[]="***********";
int left=0;
int right=strlen(a)-1;
for(;left<right;)
{
b[left]=a[left];
b[right]=a[right];
printf("%s",b);
Sleep(1000);
system("cls");
left++;
right--;
}
printf("hello word!");
return 0;
}
运用到了多个库函数
system (cls)//清空屏幕
strlen (字符串)//求长度
Sleep (1000) //休眠一秒