2011年5月31日
摘要:
题目:Problem D Problem DescriptionEddy's interest is very extensive, recently he is interested in prime number. Eddy discover the all number owned can be divided into the multiply of prime number, but he can't write program, so Eddy has to ask intelligent you to help him, he asks you to write 阅读全文
posted @ 2011-05-31 22:36
枫叶飘泪
阅读(218)
评论(0)
推荐(0)
摘要:
#include<stdio.h>#include<string.h>#include<stdlib.h>#define Max 100int prime[Max+5];void fun( ){ memset( prime,0,sizeof( prime ) );//假设MAX内所有数都是素数并赋值为0 for( int i = 2; i <= Max / 2; ++i )//分别找出所有2--MAX/2内的所有数的倍数并赋值为1,标记为非素数 for( int j = i + i; j <= Max; j += i ) prime[j] = 1 阅读全文
posted @ 2011-05-31 20:21
枫叶飘泪
阅读(199)
评论(0)
推荐(0)
浙公网安备 33010602011771号