int long long
时间: 2023-11-09 22:08:52 浏览: 92
Add_long_int
int和long long在不同系统下的取值范围是不同的。在32位系统下,unsigned int的范围是0~4294967295,int的范围是-2147483648~2147483647,unsigned long和int的范围相同,long和int的范围也相同。而long long的最大值是9223372036854775807,最小值是-9223372036854775808。
在一些历史系统或其他某些系统中,int的长度可能为2,被称为short int,而long int可能为4。这是因为不同系统对整型变量长度的定义不同。
在编程过程中,可以使用typedef来定义long long为ll,例如:
```
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll a;
cin >> a;
cout << a;
return 0;
}
```
这样就可以直接用ll代替long long的定义。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [详解 IOS下int long longlong的取值范围](https://download.csdn.net/download/weixin_38614636/14022762)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [C语言中int、long int、long long的区别](https://blog.csdn.net/weixin_30474629/article/details/117107078)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [什么是#define int long long 与signed main()(学习笔记)。](https://blog.csdn.net/weixin_51765822/article/details/113114706)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文