跳到正文

题解

A+B Problem 题解——打表

TANG2011约 2 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年8月7日
篇幅
约 2 分钟
题目
P1001

版本

  1. v1当前
C++
#include <bits/stdc++.h>
using namespace std;
inline int read(){
	int 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-48;ch=getchar();}
	return x*f;
}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    int a=read();
    int b=read();
    if(a==1&&b==2) cout<<3;
	if(a==10000000&&b==220000000) cout<<230000000;
	if(a==135131&&b==3543543) cout<<3678674;
	if(a==-123&&b==123) cout<<0;
	if(a==13213213&&-545646) cout<<12667567; 
	if(a==-1000000000&&b==-1000000000) cout<<-2000000000; 
	if(a==1000000000&&b==1000000000) cout<<2000000000;
	if(a==999999996&&b==-999999997) cout<<-1;
	if(a==0&&b==0) cout<<0;
	if(a==0&&b==-1000000000) cout<<-1000000000;
    return 0;
}
原文