摘要: #include <iostream>using namespace std;int GetIntCount(){int n=255; char Answer[8*sizeof(int)+1]; static int LEN=8*sizeof(int);for (int i = LEN - 1; i >= 0; i--, n >>= 1)Answer[i] = (01 & n) + '0';Answer[LEN] = '\0';string Str = Answer;int nCount=0;for(int i=0;i< 阅读全文
posted @ 2011-12-13 17:36 byfei 阅读(114) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;char *ok(int n,char *b) { static int LEN=8*sizeof(int); for(int i=LEN-1;i>=0;i--,n>>=1) b[i]=(01&n)+'0'; b[LEN]='\0'; return b; } int GetIntCount(string b){int nCount=0;static int LEN=8*sizeof(int); for(int i=0;i<LEN;i++){i 阅读全文
posted @ 2011-12-13 14:56 byfei 阅读(143) 评论(0) 推荐(0) 编辑