目录

int128 奇技淫巧

艹,原来的代码有错!

顺便喷一下emacs的加空格插件

特点

  1. 不支持printf,scanf,cin,cout,自己输入输出
  2. 至多可存38位
  3. 运算同int
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <bits/stdc++.h>
using namespace std;
__int128_t read() {
  __int128_t x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
__int128_t print(__int128_t x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) {
    print(x / 10);
  }
  putchar(x % 10 + '0');
}
int main() {
  __int128_t a, b;
  a = read();
  b = read();
  print(a + b);
  return 0;
}