看板Programming
标 题简易统一发票对奖程式
发信站椰林风情 (Tue Mar 27 18:19:54 2012)
转信站ptt!news.ntu!Palmarama
rem
http://www.facebook.com/pages/Simple-Basic-Programming-Algorithm/210860158955706
rem 101年1、2月统一发票中奖号码
count=1
number$[count]="59609701"
commet$[count]="特别奖"
count=count+1
number$[count]="07063353"
commet$[count]="特奖"
count=count+1
number$[count]="33640895"
commet$[count]="头奖"
count=count+1
number$[count]="67996436"
commet$[count]="头奖"
count=count+1
number$[count]="35573745"
commet$[count]="头奖"
count=count+1
number$[count]="144"
commet$[count]="增开六奖"
count=count+1
number$[count]="598"
commet$[count]="增开六奖"
100 cls
hit_list=0
input "请输入尾数号码",a$
if len(a$)=0 then 500
hit_y[hit_list+1]=0
for y=1 to count
for x=1 to len(a$)
b$=right$(a$,x)
c$=right$(number$[y],x)
if b$=c$ then hit_x[hit_list+1]=x : hit_y[hit_list+1]=y
next
if hit_y[hit_list+1]>0 then hit_list=hit_list+1 : hit_y[hit_list+1]=0
next
i=1
while i<=hit_list
k=hit_y[i]
print "尾数对中",hit_x[i],"码",commet$[k],number$[k]
if hit_x[i]=8 and commet$[k]="特别奖" then print "特别奖 1000万元"
if hit_x[i]=8 and commet$[k]="特奖" then print "特奖 200万元"
if hit_x[i]=8 and commet$[k]="头奖" then print "头奖 20万元"
if hit_x[i]=7 and commet$[k]="头奖" then print "二奖 4万元"
if hit_x[i]=6 and commet$[k]="头奖" then print "三奖 1万元"
if hit_x[i]=5 and commet$[k]="头奖" then print "四奖 4千元"
if hit_x[i]=4 and commet$[k]="头奖" then print "五奖 1千元"
if hit_x[i]=3 and commet$[k]="头奖" then print "六奖 2百元"
if hit_x[i]=3 and commet$[k]="增开六奖" then print "增开六奖 2百元"
i=i+1
wend
if hit_list=0 then print "没对中"
print
input "请按任一键继续,按Q退出",d$
if cap$(d$)<>"Q" then 100
500 end
--
☆ [Origin:椰林风情] [From: host-58-115-151-138.dynamic] [Login: **] [Post: **]
1F:→ MOONRAKER:还敢来…不要跑,待我回去电死你 118.163.12.174 03/27 19:04
2F:推 EdisonX:中邪了吗 ? 180.177.76.161 03/27 19:18
3F:推 ShadowMask:?? 114.27.30.133 03/27 19:58
4F:推 mars90226:题目到底是啥?? 125.226.2.101 03/27 22:00
5F:→ yauhh:其实他没错啦,这也叫作programming. 不过, 61.231.71.233 03/27 22:21
6F:→ yauhh:若要称为algorithm... 唉,不要来闹. 61.231.71.233 03/27 22:23
7F:→ MOONRAKER:我回来就累啦,也懒得找QB或BASIC 7.0218.160.178.149 03/28 01:13
8F:→ MOONRAKER:谁有空用个read/data电死他吧218.160.178.149 03/28 01:14
9F:→ MOONRAKER:custom type更好 给他点教训 XD218.160.178.149 03/28 01:14
10F:→ EdisonX:link 广告嫌疑 ? 180.177.76.161 03/28 09:39
11F:推 yauhh:不要啦,C/P太低180.205.139.107 03/28 10:47