005: INTEGER type storage space

 

Total time limit: 
1000ms
 
Memory Limit: 
65536kB
description

Each define a int, short type variable, and sequentially outputs them to the storage space (unit: bytes).

Entry
no.
Export
Line, two integers, namely, the size of the storage space two variables, separated by a space.
Sample input
(no)
Sample Output
(Not available)
prompt
Use sizeof function can be a particular variable amount of storage space. For example: For x int variables, the sizeof (x) is 4, i.e., the memory space x 4 bytes.
 1 #include <iostream>
 2 using namespace std;
 3 /*
 4 
 5 */
 6 int main(){
 7     int a;
 8     short b;
 9     cout<<sizeof(a)<<" "<<sizeof(b);
10     
11     return 0;
12 }

 

Guess you like

Origin www.cnblogs.com/geyang/p/12329697.html