From 26ce4f06580dfac7cffefdf04a76035ac30105c5 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Sat, 10 Jul 2021 10:37:49 +0800 Subject: [PATCH] Add __int128 Utils --- templates/int128.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 templates/int128.h diff --git a/templates/int128.h b/templates/int128.h new file mode 100644 index 00000000..ee690524 --- /dev/null +++ b/templates/int128.h @@ -0,0 +1,13 @@ +#include +#include +#include + +std::ostream& operator<<(std::ostream& __ostream, __int128 __n) { + std::string __o; + while (__n) { + __o.push_back(__n % 10 + '0'); + __n /= 10; + } + std::reverse(__o.begin(), __o.end()); + return __ostream << __o; +}