#include<stdio.h>
#include<string.h>
#include<windows.h>
int main()
{
char arr1[] = "###############";
char arr2[] = "welcome to bit!";
int left = 0, right = 0, i = 0,size=0;
size = strlen(arr1) ;
right = size - 1; // 减一为数组下标
printf("%s\n", arr1);
for (i = 0; i < (size + 1) / 2; i++) //左右同时替换,共需8次完成
{
arr1[left] = arr2[left];
arr1[right] = arr2[right];
left++;
right--;
printf("%s\n", arr1);
Sleep(1000);
}
system("pause");
return 0;
}
本文出自 “Vs吕小布” 博客,请务必保留此出处http://survive.blog.51cto.com/10728490/1701277