fork(6) download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. string s = "FF 0F F0 C3 10";
  10. stringstream ss;
  11. ss << hex << s;
  12.  
  13. unsigned int n;
  14. while(ss >> n){
  15. for (int i = 8; i >= 0; i--)
  16. cout << ((n >> i) & 1) ? "1" : "0";
  17. cout << std::endl;
  18. }
  19. }
Success #stdin #stdout 0s 4512KB
stdin
Standard input is empty
stdout
011111111
000001111
011110000
011000011
000010000