基本变量
bool true/false 1byte
char ‘c’ ‘a’ ‘\n’ ’ ’ 1byte
int (-2的31次方)~(+2的31次方-1)
-214783648 ~ 214783647 4byte
float 1.23,2.5,1.235e2
6-7位有效数字 4byte
double 15-16位有效数字 8byte
long long (-2的63次方)~(2的63次方-1) 8byte
long double 18-19位有效数字 12byte
B:Byte
b:bit
1Byte=8bit
int:%d
float:%f
double:%lf
char:%c
long long:%lld
int ->float/double直接变即可
float/double->int向下取整
int与char
‘a’ 97
‘A’ 65
’ ’ 32
‘0’ 48
cin和cout是不区分整数类型的
做运算 结果
int float/double float/double
char int int
int long long long long
float double double