00001 #include <bitset> 00002 #include <iostream> 00003 00004 using namespace std; 00005 00006 int main() { 00007 for (unsigned int i = 0; i < 20; ++i) { 00008 bitset<4> foo(i); 00009 bitset<8> bar(i); 00010 cout << "" << i << " -> " << foo << ", " << bar << endl; 00011 } 00012 return EXIT_SUCCESS; 00013 }