作者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