#include<stdio.h>
#include<string.h>
int main()
{
char arr1[] = "welcome to bit!!!!";
char arr2[] = "##################";
int left = 0;
int right = strlen(arr1) - 1;
while (left<=right)
{
arr2[left] = arr1[left];
arr2[right] = arr1[right];
left++;
right--;
printf("结果是%s\n", arr2);
}
return 0;
}
输出结果为:
标签:字符,right,int,程序,char,arr2,arr1,两边,left From: https://blog.51cto.com/u_15923331/6021154