(违龟紫衫)提供一个int128的A+B代码
查看原帖
(违龟紫衫)提供一个int128的A+B代码
465055
1004779564bzbjj楼主2024/8/7 19:40

这里直接把ll变成int128了

输入输出格式见代码

#include<bits/stdc++.h>
#define ll __int128
using namespace std;
inline ll read(){
	ll 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;
}
inline void print(ll x){
	if(x<0){
		putchar('-');
		x=-x;
	}
	if(x>9){
		print(x/10);
	}
	putchar(x%10+'0');
}
int main(){
	ll a,b;
	a=read(),b=read();
	ll c=a+b;
	print(c);
	return 0;
}
2024/8/7 19:40
加载中...