Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- constexpr uint64_t str7(const char* sz)
- {
- uint64_t res = 0;
- int i = 0;
- for(i = 0; sz[i] != '\0' && i < 7; ++i) {}
- --i;
- for(uint64_t m = 1; i >= 0; --i, m *= 256)
- res += sz[i] * m;
- return res;
- }
- uint64_t f()
- {
- return str7("TWO");
- }
- int main()
- {
- switch (f()) {
- case str7("ONE"):
- std::cout << "ONE\n";
- break;
- case str7("TWO"):
- std::cout << "TWO\n";
- break;
- default:
- std::cout << "DUNNO\n";
- }
- if (str7("A") < str7("B"))
- std::cout << "yes\n";
- else
- std::cout << "no\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment