|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
如题:下面的程序无法编译;给出的提示是:constant too big(常数太大)
//宏定义,2022.2.19。
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
//#define M 12
//#define M 15
//#define M 500
#define M 10000
//#define M 20000
#if M < 15
#undef M
#define M 15
//#elif M > 4294967296
//#undef M
//#define M 4294967296
#elif M > 18446744073709551616
#undef M
#define M 18446744073709551616
#endif
//#error
#if M < 500
#define N M / 2 - M / 10
#else
#define N M / 5
#endif
int main(void)
{
if (M <= 2147483647)
printf("M = %d, N = %d", M, N);
else if (M <= 4294967296)
printf("M = %u, N = %u", M, N);
else if (M <= 9223372036854775807)
printf("M = %I64d, N = %I64d", M, N);
else
printf("M = %I64u, N = %I64u", M, N);
getch();
return 0;
} |
|