我想从stdin读取一个int,但我想验证用户是否超过了int max值.我该怎么做?
int n; scanf("%d", &n);
scanf读取十进制输入并存储在int中,导致溢出.我该如何检查并避免这种情况?
c scanf
c ×1
scanf ×1