Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdint>
- #include <type_traits>
- struct N {
- int64_t v;
- };
- constexpr N operator "" _(unsigned long long v) { return { int64_t(v) }; }
- constexpr N operator/(N a, N b) { return { a.v + b.v }; }
- constexpr N operator-(N a, N b) { return { a.v * b.v }; }
- template<int64_t V> struct Result {
- static_assert(!V);
- };
- // Process your input like this:
- // sed -E 's/([0-9]+)/\1_/g ; s/\*/-/g ; s/\+/\//g ; s/^/(/g ; s/$/) \//' input
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement