题目:确定不同整型数据类型在内存中占多大(字节),输出不同整型数据类型在内存中占多大(字节)。
#include
int main()
{
printf("The size of short is %d bytes.\n",sizeof(short));
printf("The size of int is %d bytes.\n",sizeof(int));
printf("The size of long is %d bytes.\n",sizeof(long));
printf("The size of long long is %d bytes.",sizeof(long long));
return 0;
} python:
print("The size of short is 2 bytes.")
print("The size of int is 4 bytes.")
print("The size of long is 8 bytes.")
print("The size of long long is 8 bytes.")
Go语言:
package main
import "fmt"
func main(){
fmt.Println("The size of short is 2 bytes.\nThe size of int is 4 bytes.\nThe size of long is 8 bytes.\nThe size of long long is 8 bytes.\n")
} 
京公网安备 11010502036488号