#include <stdio.h> #include <limits.h> #define MYMAX(T) \ (- ( ( 1<< ( sizeof ( T ) * 8 - 1 ) ) + 1)) #define MYMIN(T) \ (1 << ( sizeof ( T ) * 8 - 1 )) int main(int argc, char const *argv[]) { printf("%d\n", - ( ( 1<< ( sizeof ( int ) * 8 - 1 ) ) + 1)); printf("%d\n", INT_MAX); printf("%d\n", 1 << ( sizeof ( int ) * 8 - 1 )); printf("%d\n", INT_MIN); printf("%d\n", MYMAX(int)); printf("%lld\n", MYMAX(long long )); printf("%d\n", MYMIN(int)); return 0; }
时间: 2024-10-16 14:33:21