You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
989 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
int main() {
/*
%d 32
%u 32
%lld 64
*/
printf("short:%d bytes,max=%d,min=%d\n", (int)sizeof(short), SHRT_MAX, SHRT_MIN);
printf("unsigned short:%d bytes,max=%d\n", (int)sizeof(unsigned short), USHRT_MAX, 0);
puts("");
printf("int:%d bytes,max=%d,min=%d\n", (int)sizeof(int), INT_MAX, INT_MIN);
printf("unsigned int:%d bytes,max=%u\n", (int)sizeof(unsigned int), UINT_MAX, 0);
puts("");
printf("long long:%d bytes,max=%lld,min=%lld\n", (int)sizeof(long long));
//使用 %lld 就可以打印一个unsigned long long了glib中的guint64就是unsigned long long。这是GNU编译器支持的。
printf("unsigned long long:%d bytes,max=%lld,min=%d\n", (int)sizeof(unsigned long long));
double a = 1, b = 1;
if (a * b == 1)
printf("True");
else
printf("False");
return 0;
}