/*
BC3 有容乃大
描述
确定不同整型数据类型在内存中占多大(字节),输出不同整型数据类型在内存中占多大(字节)。
输入描述:
无
输出描述:
不同整型数据类型在内存中占多大(字节),具体格式详见输出样例,输出样例中的?为不同整型数据类型在内存中占的字节数。输出样例如下:
The size of short is ? bytes.
The size of int is ? bytes.
The size of long is ? bytes.
The size of long long is ? bytes.
*/
#include<stdio.h>
int main()
{
int a=0,b=0,c=0,d=0;
a=sizeof(short);
b=sizeof(int);
c=sizeof(long);
d=sizeof(long long);
printf("The size of short is %d bytes.\n",a);
printf("The size of int is %d bytes.\n",b);
printf("The size of long is %d bytes.\n",c);
printf("The size of long long is %d bytes.\n",d);
}
牛客网BC3
最新推荐文章于 2023-02-05 18:53:59 发布