作者cocoyan (錐子)
看板NTUBSE-B-96
標題[計程] 作業六
時間Thu Apr 3 23:25:10 2008
An integer is said to be prime if it is divisible by only 1 and itself.
For example,2,3,5 and 7 are prime,but 4,6,8 and 9 are not.
a) Write a function that determines if a number is prime.
b) Use this function in a program that determines and prints all the prime
numbers between 1 and 10,000. How many of these 10,000 numbers do you
really have to test before being sure that you have found all the primes?
--
如果我們具有磁場,
則當我們每次經過電冰箱門的時候,
我們都可能會與冰箱門撞在一起,
所以人的身體不具有磁場是有其優點的。
節錄自Fundamentals of Physics 7ed by Halliday&Resnick&Jearl Walker
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.242.26
推 v900149:水喔~~ 還沒要就給題目了~~ 04/03 23:48
→ cocoyan:有別人先要了XD 04/04 01:17
→ v900149:有沒有(C)哩?? 04/06 20:10
→ cities:不是只要(b)就好了? 04/06 21:03