C,
The int and long ranges are the same and can only be expressed (-2 ^ 31 ~ 2 ^ 31) INTEGER (-2 billion ~ 2 billion)
The range of unsigned int and unsigned long is (0 ~ 2 ^ 32), 4 billion more.
If you want to represent larger integers, these two data types are not easy to use. In ACM, you often need to process such data types. In the past, my stupid method was to create an integer array, each a [I] stores one bit, so that the addition, subtraction, multiplication, division operations must be defined by themselves. I just saw a section on the InternetCodeIt uses _ int64 and 8 bytes to store integers. For more information, seeArticle, The following describes its range and usage:
_ Int64, range (-2 ^ 63 ~ 2 ^ 63), that is, (-92.2 billion million ~ 92.2 billion million)
Unsigned _ int64, range (0 ~ 2 ^ 64), 184.4 billion.
_ Int64 supports four mixed operations and bit operations. Operations of the int type are automatically converted to _ int64.
Input and Output in VC 6.0:
_ Int64:
Scanf ("% i64d", amp; );
Printf ("% i64d", );
Unsigned _ int64
Scanf ("% i64u", amp; );
Printf ("% i64u", );
Input and Output in Dev C:
Long long;
A = 00000000000000000ll
Always add LL
Cin>;
Cout <
Scanf ("% i64d", amp; );
Printf ("% i64d", );
The usage of the symbol is similar.