When doing interdependent problems, sometimes overflow or high-precision operations are performed. At this time, I was confused by the novice who did not understand these basic types and did not pay much attention, so (Baidu) took a look. Found seniors and did a good job.
First post the original link : int short. . . difference
It is understood, but we also have to practice
Experimental purpose: Create the corresponding type to see how many bits can be input. So as to get a direct feeling of the number of storable bits
Environment: eclipse
int:
When we enter 20 numbers, an error is reported, indicating that the data length is exceeded
No error when we cut down to only ten numbers
Intuitive result: int can store up to 10 numbers;
long:
Also only 10
Comparison chart This is the correct number for each maximum input