2012年9月3日
摘要: 下面是摘抄网友的的代码void fun(int i, char *res){ int j = 0; while(i){ *(res + j) = i % 2 + '0'; i /= 2; ++j; } *(res + j) = '\0'; strrev(res);}这个感觉太冗长了。而后是这个:#include <iostream>#include <bitset>#include <string>void printBinary(int n) { std::bitset<32> bits(n); for (i.. 阅读全文
posted @ 2012-09-03 13:35 hcu5555 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 包括printf ,scanf等常用的和不常用的打印集合 阅读全文
posted @ 2012-09-03 11:41 hcu5555 阅读(242) 评论(0) 推荐(0) 编辑