P1001 A+B Problem —— 常见数据类型的取值范围
题目描述
https://www.luogu.com.cn/problem/P1001
代码:
#include <cstdio>
int main(){
long long a,b;
scanf("%d %d",&a,&b);
printf("%d",a+b);
}
遇到问题:
- scanf 和 printf 在使用时需要有头文件 #include <cstdio>
-
类型 范围 unsigned int 0 ~ 4294967295 int -2147483648 ~ 2147483647 unsigned long 0 ~ 4294967295 long -2147483648 ~ 2147483647 long long -9223372036854775808 ~ 9223372036854775807 unsigned long long 0 ~ 18446744073709551615 __int64 -9223372036854775808 ~ 9223372036854775807 unsigned __int64 0 ~ 18446744073709551615