这个没什么难得主要是控制一下a,b的范围即可
#include using namespace std;
int main() {
// write your code here......
int a,b,s=0;
scanf("%d%d",&a,&b);
if(a>-1000&&a<1000 && b>-1000&&b<1000)
s=a+b;
printf("%d",s);
return 0;
}
这个没什么难得主要是控制一下a,b的范围即可
#include using namespace std;
int main() {
// write your code here......
int a,b,s=0;
scanf("%d%d",&a,&b);
if(a>-1000&&a<1000 && b>-1000&&b<1000)
s=a+b;
printf("%d",s);
return 0;
}