/*
翻转字符串
*/



void __rev(char *s)




{




char *p=s;




char *q=s;




char temp;




while('\0'!=*(++q+1));




while(p<q)




{




if(*p!=*q)




{




temp=*p;




*p=*q;




*q=temp;




}




++p;




--q;




}




}



/*
整形转字符串(字符串倒序)


如需正序要调用反装字符串函数
*/


{



int sign=n;



if(sign<0)



n=-n;



int i=0;



do



{



s[i++]=n%10+'0';//取最后一位数转换







n=n/10;//删除最后一位







}while(n>0);







if(sign<0)



s[i++]='-';



s[i]='\0';



if(sign>=0)


__rev(s); //翻转字符串


}