急!毕业论文VFP程序修改,谢谢!
public a,b,c,d,e,i,j,zks,bh,m,n,n1,n2,n3,n4 &&m为节次,n为星期
n1=1
n2=1
n3=1
n4=1
close all
use 基本参数表
a=高一班数
b=高二文科班数
c=高二理科班数
d=高三文科班数
e=高三理科班数
public i
for i=1 to a
close all
use 班级课表
go top
loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="语文"
if found()
y=allt(优先级)
z=周课时
bh=recno()
do case
case z>5
for j=1 to z
m=int(6*rand()+1)
n=int(5*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
endfor
case z=5
for j=1 to 5
m=int(4*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
endfor
case z=4
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
n4=int(5*rand()+1)
for j=1 to 4
m=int(4*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
case j=4
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
endcase
endfor
case z=3
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
for j=1 to 3
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
endcase
endfor
case z=2
n1=int(5*rand()+1)
n2=int(5*rand()+1)
for j=1 to 2
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
endcase
endfor
case z=1
m=int(5*rand()+1)
n=int(5*rand()+1)
go bh
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
endcase
endif
loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="数学"
if found()
y=allt(优先级)
z=周课时
bh=recno()
do case
case z>5
for j=1 to z
m=int(4*rand()+1)
n=int(5*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
endfor
case z=5
for j=1 to 5
m=int(4*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
endfor
case z=4
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
n4=int(5*rand()+1)
for j=1 to 4
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
case j=4
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
endcase
endfor
case z=3
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
for j=1 to 3
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
endcase
endfor
case z=2
n1=int(5*rand()+1)
n2=int(5*rand()+1)
for j=1 to 2
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
endcase
endfor
case z=1
m=int(5*rand()+1)
n=int(5*rand()+1)
go bh
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
endcase
endif
loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="英语"
if found()
y=allt(优先级)
z=周课时
bh=recno()
do case
case z>5
for j=1 to z
m=int(4*rand()+1)
n=int(5*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
endfor
case z=5
for j=1 to 5
m=int(4*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
endfor
case z=4
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
n4=int(5*rand()+1)
for j=1 to 4
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
case j=4
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
endcase
endfor
case z=3
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
for j=1 to 3
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
endcase
endfor
case z=2
n1=int(5*rand()+1)
n2=int(5*rand()+1)
for j=1 to 2
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
endcase
endfor
case z=1
m=int(5*rand()+1)
n=int(5*rand()+1)
go bh
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
endcase
endif
loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="物理"
if found()
y=allt(优先级)
z=周课时
bh=recno()
do case
case y="高"
do case
case z>5
for j=1 to z
m=int(7*rand()+1)
n=int(5*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
endfor
case z=5
for j=1 to 5
m=int(6*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
endfor
case z=4
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
n4=int(5*rand()+1)
for j=1 to 4
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
case j=4
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
endcase
endfor
case z=3
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
for j=1 to 3
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
endcase
endfor
case z=2
n1=int(5*rand()+1)
n2=int(5*rand()+1)
for j=1 to 2
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
endcase
endfor
case z=1
m=int(5*rand()+1)
n=int(5*rand()+1)
go bh
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
endcase
case y="中"
do case
case z>5
for j=1 to z
m=int(4*rand()+4)
n=int(5*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
endfor
case z=5
for j=1 to 5
m=int(4*rand()+4)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
endfor
case z=4
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
n4=int(5*rand()+1)
for j=1 to 4
m=int(4*rand()+4)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
case j=4
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
endcase
endfor
case z=3
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
for j=1 to 3
m=int(4*rand()+4)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
endcase
endfor
case z=2
n1=int(5*rand()+1)
n2=int(5*rand()+1)
for j=1 to 2
m=int(4*rand()+4)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
endcase
endfor
case z=1
m=int(4*rand()+4)
n=int(5*rand()+1)
go bh
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
endcase
endcase
endif
loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="化学"
if found()
y=allt(优先级)
z=周课时
bh=recno()
do case
case y="高"
do case
case z>5
for j=1 to z
m=int(7*rand()+1)
n=int(5*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
endfor
case z=5
for j=1 to 5
m=int(6*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
endfor
case z=4
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
n4=int(5*rand()+1)
for j=1 to 4
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
case j=4
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
endcase
endfor
case z=3
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
for j=1 to 3
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
endcase
endfor
case z=2
n1=int(5*rand()+1)
n2=int(5*rand()+1)
for j=1 to 2
m=int(5*rand()+1)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
endcase
endfor
case z=1
m=int(5*rand()+1)
n=int(5*rand()+1)
go bh
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
endcase
case y="中"
do case
case z>5
for j=1 to z
m=int(4*rand()+4)
n=int(5*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
endfor
case z=5
for j=1 to 5
m=int(4*rand()+4)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
endfor
case z=4
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
n4=int(5*rand()+1)
for j=1 to 4
m=int(4*rand()+4)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
case j=4
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
endcase
endfor
case z=3
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
for j=1 to 3
m=int(4*rand()+4)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
endcase
endfor
case z=2
n1=int(5*rand()+1)
n2=int(5*rand()+1)
for j=1 to 2
m=int(4*rand()+4)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
endcase
endfor
case z=1
m=int(4*rand()+4)
n=int(5*rand()+1)
go bh
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
endcase
endcase
endif
loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="地理"
if found()
y=allt(优先级)
z=周课时
bh=recno()
do case
case y="中"
do case
case z>5
for j=1 to z
m=int(4*rand()+4)
n=int(5*rand()+1)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
endfor
case z=5
for j=1 to 5
m=int(4*rand()+4)
go bh+j-1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
endfor
case z=4
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
n4=int(5*rand()+1)
for j=1 to 4
m=int(4*rand()+4)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
case j=4
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
endcase
endfor
case z=3
n1=int(5*rand()+1)
n2=int(5*rand()+1)
n3=int(5*rand()+1)
for j=1 to 3
m=int(4*rand()+4)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
case j=3
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
endcase
endfor
case z=2
n1=int(5*rand()+1)
n2=int(5*rand()+1)
for j=1 to 2
m=int(4*rand()+4)
go bh+j-1
do case
case j=1
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
case j=2
repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
endcase
endfor
case z=1
m=int(4*rand()+4)
&n