看板Programming
标 题101年1、2月统一发票兑奖
发信站椰林风情 (Tue Mar 27 10:31:43 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]="增开六奖"
count=count+1
100 cls
input "请输入尾数号码",a$
if len(a$)=0 then 500
hit_y=0
for x=1 to len(a$)
b$=right$(a$,x)
for y=1 to count
c$=right$(number$[y],x)
if b$=c$ then hit_x=x : hit_y=y
next
next
if hit_y>0 then print "尾数对中",hit_x,"码",commet$[hit_y],number$[hit_y] else print "没对中"
if hit_y>0 and hit_x=8 and commet$[hit_y]="特别奖" then print "特别奖 1000万元"
if hit_y>0 and hit_x=8 and commet$[hit_y]="特奖" then print "特奖 200万元"
if hit_y>0 and hit_x=8 and commet$[hit_y]="头奖" then print "头奖 20万元"
if hit_y>0 and hit_x=7 and commet$[hit_y]="头奖" then print "二奖 4万元"
if hit_y>0 and hit_x=6 and commet$[hit_y]="头奖" then print "三奖 1万元"
if hit_y>0 and hit_x=5 and commet$[hit_y]="头奖" then print "四奖 4千元"
if hit_y>0 and hit_x=4 and commet$[hit_y]="头奖" then print "五奖 1千元"
if hit_y>0 and hit_x=3 and commet$[hit_y]="头奖" then print "六奖 2百元"
if hit_y>0 and hit_x=3 and commet$[hit_y]="增开六奖" then print "增开六奖 2百元"
print
input "请按任一键继续,按Q退出",d$
if cap$(d$)<>"Q" then 100
500 end
--
☆ [Origin:椰林风情] [From: host-58-115-151-138.dynamic] [Login: **] [Post: **]
1F:→ MOONRAKER:都写这种老掉牙BASIC 为何不用data/read 118.163.12.174 03/27 11:39
2F:→ MOONRAKER:就算合成个大字串也好 看得我览趴拢火 118.163.12.174 03/27 11:39
3F:→ MOONRAKER:底下的if连发也是不知所云,完全失去前 118.163.12.174 03/27 11:40
4F:→ MOONRAKER:面建阵列的意义。这是不是30年前的新手 118.163.12.174 03/27 11:41
5F:→ MOONRAKER:经过时光隧道发过来的? 118.163.12.174 03/27 11:41
6F:→ ShadowMask:囧 114.27.30.133 03/27 12:01
7F:→ MOONRAKER:好吧30年前每行都要行号,那20年吧… 118.163.12.174 03/27 14:53
8F:推 yauhh:我的妈,没中奖的还要一笔笔输入... 49.214.66.64 03/27 16:46
9F:推 yoco315:这……我十七年前 T_T 好怀念...182.235.170.158 03/28 10:09
10F:→ yoco315:眼泪快掉下来惹 /_\182.235.170.158 03/28 10:09
11F:推 s3748679:忽然八卦起来.. 想知道十七年前是.. 218.164.80.184 04/02 01:09
12F:→ s3748679:有什麽事呀@@... 218.164.80.184 04/02 01:10