/*
标识符命名规则:
1、标识符不可以是关键字
int int = 10;
2、标识符只能由字母、数字、下划线组成,且不能以数字开头
int abc = 10;
int _abc = 10;
int _123abc = 10;
int 123abc = 40; // x
3、标识符严格区分大小写
*///建议: 给变量起名的时候,最好
5. 整型和浮点型
#include<iostream>#include<cstdio>#include<cstdlib>usingnamespace std;intmain(){//整型//1.短整型 (-32768 ~ 32767)short a =1;//2.整型int b =32768;//3.长整型long c =1;//4.长长整型longlong d =1;
cout <<"a = "<< a << endl;//sizeof()方法是用来计算变量所占内存空间的大小
cout <<"short 类型所占内存空间为: "<<sizeof(a)<< endl;
cout <<"b = "<< b << endl;
cout <<"int 类型所占内存空间为: "<<sizeof(b)<< endl;
cout <<"c = "<< c << endl;
cout <<"long 类型所占内存空间为: "<<sizeof(c)<< endl;
cout <<"d = "<< d << endl;
cout <<"long long 类型所占内存空间为: "<<sizeof(d)<< endl;return0;}