Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为什么我加stdio.h就总是WA,而我把stdio.h去掉就马上可以通过了,这么奇怪的?!#define SIZE 10000 #define TRUE 0 #define FALSE 1 int main() { unsigned char self_num[SIZE]; int n, i, sum; for (n = 0; n <SIZE; n++) { self_num[n] = TRUE; } for (n = 1; n < SIZE; n++) { if (self_num[n] == TRUE) { i = n; while (i < SIZE) { sum = i; sum += i % 10; i /= 10; sum += i % 10; i /= 10; sum += i % 10; i /= 10; sum += i % 10; if (sum < SIZE) { self_num[sum] = FALSE; } i = sum; } } } for (n = 1; n < SIZE; n++) { if (self_num[n] == TRUE) { printf("%d\n", n); } } return 0; } 我的代码如上,我是使用负逻辑进行运算的,是不是我的define出现了问题? Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator