# include <stdio.h>
int main()
{
char arr1[] = "jiakesinb!!!";
char arr2[] = "############";
int left = 0;//左下标
//int right = sizeof(arr1) / sizeof(arr1[0])-2;//右下标,数组最后有“\0”
int right = strlen(arr1)-1;//右下标
while (left<=right)
{
arr2[left] = arr1[left];
arr2[right] = arr1[right];
printf("%s\n", arr2);
left++;
right--;
}
return 0;
}
标签:right,下标,int,char,中间,arr1,两边,字符串,sizeof
From: https://blog.51cto.com/u_16150211/6447242