C语言,编写一个函数:将给定字符串逆序

日期:2016-01-15 00:41:59 人气:1

C语言,编写一个函数:将给定字符串逆序

#include #include #include void main() { char str,ch[]="this is a book"; int i,j,len; len=strlen(ch); for(i=0,j=len-1;i<j;++i,--j) { str=ch[i]; ch[i]=ch[j]; ch[j]=str; } puts(ch); return 0; }
    A+
热门评论