__int128模版望改正
  • 板块学术版
  • 楼主Lovely_Elaina
  • 当前回复2
  • 已保存回复2
  • 发布时间2023/1/4 10:28
  • 上次更新2023/10/24 05:38:10
查看原帖
__int128模版望改正
781159
Lovely_Elaina楼主2023/1/4 10:28

RT,谢谢

#include <bits/stdc++.h>
#define __int128 int
using namespace std;

int read() {
    char c = getchar();
    int x = 0,f = 1;
    for(; !isdigit(c); c=getchar())
        if(c == '-')
            f = -1;
    for(; isdigit(c); c=getchar())
        x = x * 10 + c - 48;
    return x * f;
}

void print(__int128 x){
	if(x<0){
		putchar('-');
		x=-x;
	}
	if(x<10){
		putchar(x+48);
		return;
	}
	print(x/10);
	putchar(x%10+48);
}

signed main(){
    
    int a,b;
    a = read();
    b = read();
    print(a+b);
    
    return 0;
}
2023/1/4 10:28
加载中...