摘要:
#include void strrev(char *s){ char *p=s,t; if(*p) while(p[1]) p++; while(s<p) { t=*s; *s++=*p; *p--=t; }}char* itoa(int num,char *result){ int i=0; while(num) { result[i++] = num%10 + '0'; num /= 10; } result[i]=0; ... 阅读全文
posted @ 2013-07-23 16:40
浪浪辛
阅读(232)
评论(0)
推荐(0)
摘要:
1 #include 2 //将字符串s倒叙 3 void strrev(char *s) 4 { 5 char *p=s,t; 6 if(*p) 7 while(p[1]) 8 p++; 9 while(s<p)10 {11 t=*s;12 *s++=*p;13 *p--=t;14 }15 16 }17 void main ()18 {19 char s[]="abcdef";20 strrev(s);21 puts(s);22 }23 ... 阅读全文
posted @ 2013-07-23 16:09
浪浪辛
阅读(203)
评论(0)
推荐(0)

浙公网安备 33010602011771号