#include<stdio.h>
int main()
{
char s[1024]="";
scanf("%s",s); //字符数组和普通数组初始化方式不同
int i,j;
int len ;
char ch;
len = sizeof (s) /sizeof(s[0]) ;
printf ("the lenth is %d\n",len); //字符数组的长度和数组一样在初始化的时候已经界定
for(j=0;s[j];j++);
printf ("len=%d\n",j) ;
j-- ; //数组的下标从0开始,故最后一位的下标是非0长度-1 ;
for(i=0,j;i<j;i++,j--)
{
ch = s[i];
s[i] = s[j];
s[j] = ch;
}
printf("s = %s\n",s);
return 0;
}