Guest User

Untitled

a guest
Jul 17th, 2020
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. constexpr uint64_t str7(const char* sz)
  4. {
  5.     uint64_t res = 0;
  6.     int i = 0;
  7.     for(i = 0; sz[i] != '\0' && i < 7; ++i) {}
  8.     --i;
  9.     for(uint64_t m = 1; i >= 0; --i, m *= 256)
  10.         res += sz[i] * m;
  11.     return res;
  12. }
  13.  
  14. uint64_t f()
  15. {
  16.     return str7("TWO");
  17. }
  18.  
  19. int main()
  20. {
  21.     switch (f()) {
  22.         case str7("ONE"):
  23.             std::cout << "ONE\n";
  24.             break;
  25.         case str7("TWO"):
  26.             std::cout << "TWO\n";
  27.             break;
  28.         default:
  29.             std::cout << "DUNNO\n";
  30.     }
  31.  
  32.     if (str7("A") < str7("B"))
  33.         std::cout << "yes\n";
  34.     else
  35.         std::cout << "no\n";
  36.  
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment