//const + 类型名用于常量
//类型名或 auto(根据值确定类型)用于变量
//整数
int number = 42, otherNumber = 37;
const unsigned long long maxUInt64 = ULLONG_MAX;
constexpr int Mb = 1048576;
//精确宽度整数(stdint.h)
uint8_t byte = 255;
int32_t million = 1'000'000;
//双精度浮点数
const double e = 2.71828;
double billion = 1E+9;
//单精度浮点数
const float pi = 3.14f;
//字符串:末尾带零字符的 char 数组
const char *greeting = "Hello";
//多行字符串:编译器把相邻的字面量粘在一起
const char *text = "this is some\n"
"multiline text";
//text is "this is some\nmultiline text"
//Bool(从 C23 起为关键字)
const bool sunIsStar = true;
auto needBackUp = false;
//字符 "A"
char charA = 'A'; //65, 0x41, '\x41'
printf("number is %d\n", number);
printf("otherNumber is %d\n", otherNumber);
printf("maxUInt64 is %llu\n", maxUInt64);
printf("Mb is %d\n", Mb);
printf("byte is %d\n", byte);
printf("million is %d\n", million);
printf("e is %g\n", e);
printf("billion is %g\n", billion);
printf("pi is %g\n", pi);
printf("greeting is %s\n", greeting);
printf("text is %s\n", text);
printf("sunIsStar is %s\n", sunIsStar ? "true" : "false");
printf("needBackUp is %s\n", needBackUp ? "true" : "false");
printf("charA is %c\n", charA);