标签:style blog color ar for div sp log on
方法:
十进制转十六进制-------除十六取余倒排
十进制转二进制--------除二取余倒排
void Convert(long Input ,char *output){ vector<char> v; int te; while(Input){ int te = Input%16; if(te<10) v.push_back(te+‘0‘); else v.push_back(te-10+‘A‘); Input /= 16; } int len = v.size(); long r = 0; for(int i = len-1;i>=0;i--){ *(output++) = v[i]; } *output = ‘\0‘; }
标签:style blog color ar for div sp log on
原文地址:http://www.cnblogs.com/Xylophone/p/3968793.html