作者goaremdy (我要當氣質型男)
看板NTUBSE-B-98
標題Re: [轉錄][求救] 生工系一年級的計算機程式應用
時間Mon Apr 19 22:58:05 2010
原文補上
5.24
An integer is said to be prime if it is divisible by only 1 and ifself.
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 number 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?
還有一個(c)啦,但是只要寫a,b就好。
我說b-2不會是見仁見智吧??
有請傅神或口卡資碼神解答!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.242.75
1F:推 chinting :謝謝大神!! 04/20 00:42
2F:→ goaremdy :PO認真文就沒人推?!?!?!?! 04/20 00:48
3F:→ Hachi329 :對阿:D 04/20 00:51
4F:噓 andyhihaho :純噓原PO 04/20 01:00
5F:推 Hachi329 :樓上是不是被我耍了怨念很深阿 XDDD 04/20 01:06
6F:噓 shcyril : 04/20 01:09
7F:推 dannyace :cyril必推 04/20 01:19
8F:噓 andyhihaho : 04/20 13:02
9F:噓 dannyace :andyhihaho必噓 04/20 13:05
10F:推 bcjohn :cyril必推 04/20 13:07
11F:噓 andyhihaho := = 04/20 13:07
12F:推 Hachi329 :總覺得推文也可以慢半拍還滿屌的 04/20 13:10
13F:推 dannyace :bcjohn必推 04/20 13:21
14F:噓 shcyril : 04/20 18:22
15F:推 dannyace :cyril必推 04/20 18:29
16F:→ i19hasen :可以PRINT出來就好了嗎? 04/20 19:43
17F:→ DKer :是可以,不過會看code,最後有機會A+的一定是效率高的 04/20 21:29
18F:推 Hachi329 :連助教都只給你箭頭 XDDDDD 04/20 22:19
19F:推 DKer :CD中 不要介意XD 04/20 22:50
20F:→ goaremdy :好感動T_T 04/20 23:54
21F:推 Hachi329 :助教也太溫馨了 溫馨代表 XD 04/20 23:59