|
|

楼主 |
发表于 5-11-2009 09:50 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-11-2009 09:51 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-11-2009 10:01 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 5-11-2009 10:14 PM
|
显示全部楼层
- start
- read unit
- if unit <200
- display "A x 20sen"
- else if unit>300
- display "a x 20sen +B x 25sen"
- else if unit < 300
- display "Ax20sen+B x 25sen+C x28sen"
- stop
复制代码
你的第一个if 已经不符合first 200=20sen
第二个和第三个完全错了。
你有时间解释, 倒不如拿那些时间读书。 |
|
|
|
|
|
|
|
|
|
|
发表于 5-11-2009 10:39 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-11-2009 10:54 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 5-11-2009 10:56 PM
|
显示全部楼层
原帖由 spannar90^_^ 于 5-11-2009 10:54 PM 发表 
那么那个应该怎样改?
你知道 < 是什么来的吗? |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-11-2009 11:03 PM
|
显示全部楼层
回复 67# 糯米鸡 的帖子
那个不是小过吗? 
[ 本帖最后由 spannar90^_^ 于 5-11-2009 11:17 PM 编辑 ] |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-11-2009 11:04 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-11-2009 11:20 PM
|
显示全部楼层
回复 67# 糯米鸡 的帖子
|
糯米鸡,你在那里吗?因为这个不熟。但是还知道怎样用。应该是怎样的? |
|
|
|
|
|
|
|
|
|
|
发表于 5-11-2009 11:27 PM
|
显示全部楼层
|
你一个个unit放进去就知道了。 比如将150, 200, 250, 300, 350 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-11-2009 11:31 PM
|
显示全部楼层
不是很明白。不过要拿symbol来代替吗?因为题目是pseudocode。只是要写出来而已。
sample.
start
total=0
for(i=1;i_< 10;add i to 1)
total=total +i
stop |
|
|
|
|
|
|
|
|
|
|
发表于 5-11-2009 11:32 PM
|
显示全部楼层
原帖由 onlylonly 于 5-11-2009 09:42 PM 发表 
这是统考, 无须奇怪, 统考久等于你现在读的 STPM,于 A-LEVEL 同样等级。
我的老师说没有A-LVL这样高哦。不过最近几年出的题目比较有A-LVL水准了 |
|
|
|
|
|
|
|
|
|
|
发表于 5-11-2009 11:41 PM
|
显示全部楼层
- if ( unit<=300 )
- {
- if ( unit<=200 )
- total = unit*20;
- else
- total = 200*20 + (unit-200)*25;
- }
- else
- {
- total = 200*20 + 100*25 + (unit-200-100)*28;
- }
复制代码 以上可以供参考。
也欢迎高手置评。
[ 本帖最后由 mash143 于 5-11-2009 11:44 PM 编辑 ] |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-11-2009 11:46 PM
|
显示全部楼层
回复 74# mash143 的帖子
|
哦,原来是这样的。他所谓说的是拿最大的放上面。然后才在内做。明白一点。谢谢。 |
|
|
|
|
|
|
|
|
|
|
发表于 5-11-2009 11:50 PM
|
显示全部楼层
回复 75# spannar90^_^ 的帖子
|
不一定要这样的。可以有别的解法(思路)的 。要自己多想想。加油。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-11-2009 11:53 PM
|
显示全部楼层
然后另一个题目。
start wait reading one character code and two integer entered by a user.if the character code is I,diplay the sum of two integer.if the character code is B,display the difference betwwen the two integer.if the character is K.display message the end and stop.if others than above this type code.display wrong code..the algorithm will repeat as long as the user does not input the end character code
start
read code
if code='I'
display"sum of two integer"
else if code='B'
display"difference of two integer"
else if code='K'
display "the end"
else if code 'others'
display "wrong code"
stop
是这样吗? |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-11-2009 11:58 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 6-11-2009 10:09 AM
|
显示全部楼层
- if(total_unit > 300)
- {
- additional_unit = total_unit - 300;
- next_unit = 100;
- first_unit = 200;
- }
- else if(total_unit > 200 && total_unit <= 300)
- {
- additional_unit = 0;
- next_unit = total_unit - 200;
- first_unit = 200;
- }
- else if(total_unit <= 200)
- {
- additional_unit = 0;
- next_unit = 0;
- first_unit = total_unit;
- }
- additional_price = additional_unit * 28;
- next_price = next_unit * 25;
- first_price = first_unit * 20;
- total_price = first_price + next_price + additional_price;
复制代码 有时问题并不是要从头做到尾,其实也可以从尾倒回头的解决的。 |
|
|
|
|
|
|
|
|
|
|
发表于 6-11-2009 10:25 AM
|
显示全部楼层
原帖由 spannar90^_^ 于 5-11-2009 11:53 PM 发表 
然后另一个题目。
start wait reading one character code and two integer entered by a user.if the character code is I,diplay the sum of two integer.if the character code is B,display the difference bet ...
不完全对。你的逻辑思考有待改善。- start
- read code
- if code='I'
- get integer1
- get integer2
- display (integer1 + integer2), go to start
- else if code='B'
- get integer1
- get integer2
- display (integer1 - integer2), go to start
- else if code='K'
- display "the end", go to stop
- else if code 'others'
- display "wrong code", go to start
- stop
复制代码
[ 本帖最后由 geekman 于 6-11-2009 10:28 AM 编辑 ] |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|