fork download
  1. #include <iostream>
  2. #include <cstdint>
  3.  
  4. void print_line(uint64_t y, uint64_t x)
  5. {
  6. while (x)
  7. {
  8. std::cout << " *"[x & 1];
  9. x >>= 1;
  10. x += ((y & 1) << 63);
  11. y >>= 1;
  12. }
  13.  
  14. std::cout << '\n';
  15. }
  16.  
  17. int main()
  18. {
  19. uint64_t x = 1;
  20. uint64_t y = 0;
  21. do
  22. {
  23. print_line(y,x);
  24. y ^= ((x & (1 << 63)) == 0 ? 0 : 1) + (y << 1);
  25. x ^= x << 1;
  26. } while (x + y!= 1);
  27. }
  28.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/cstdint:40,
                 from prog.cpp:2:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/c++0x_warning.h:36:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
prog.cpp: In function ‘int main()’:
prog.cpp:24: warning: left shift count >= width of type
stdout
Standard output is empty