摘要:#include #include //注意这种实现方法,unsigned Reverse( unsigned a ){ unsigned b = 0; for( ; a; a/=10 ) { b = b*10 + a%10; } return b;}int main(void){int a = 2... 阅读全文
字符串逆序(使用指针实现)
2014-09-24 16:03 by 忘川沧海328, 1146 阅读, 0 推荐, 收藏,
摘要:#include #include #include char* Reverse(char* s){//将q指向字符串最后一个字符 char* q = s ;while( *q++ ) ; q -= 2 ; //分配空间,存储逆序后的字符串。 char* p = (char *)malloc(siz... 阅读全文
浙公网安备 33010602011771号