主题:路过的大哥大姐帮小弟看看吧谢谢·····················
我想做一个课表下面的程序错哪了?帮忙看看谢谢···
parameter(nm=8,nu=5)
character kc(10),x
data kc/'Fortran','English','Mao@deng',
+'Water resource','Materials','tiyu',
+'jisuan','xingshi','dizhi','***'/
integer pst(nm,nu)
write(*,*)'enter x=?'
read(*,*) x
do 10,i=1,nm
pst(i,1)=i
10 continue
do 15,i=1,nu
pst(1,i)=i
15 continue
do 20,i=1,nm
do 30,j=1,nu
pst(i,j)=pst(1,j)*pst(i,1)
30 continue
20 continue
do 25,i=1,4
pst(i,1)=1
25 continue
pst(5,1)=2
pst(6,1)=2
pst(7,1)=3
pst(8,1)=3
do 35,i=1,4
pst(i,2)=4
35 continue
do 45,i=5,8
pst(i,2)=5
45 continue
pst(1,3)=3
pst(2,3)=3
pst(3,3)=6
pst(4,3)=6
pst(5,3)=7
pst(6,3)=7
pst(7,3)=10
pst(8,3)=10
do 50,i=1,4
pst(i,4)=2
50 continue
pst(5,4)=7
pst(6,4)=7
pst(7,4)=4
pst(8,4)=4
do 55,i=5,8
pst(i,5)=9
55 continue
pst(3,5)=5
pst(4,5)=5
pst(1,5)=8
pst(2,5)=8
write(*,100)
do 40,i=1,8
write(*,200)(pst(i,j),j=1,5)
40 continue
100 format(/2x,' ~@/@~ ~@/@~ ~@/@~ ~@/@~ ~@/@~')
200 format(/2x,20i4)
do 1,i=1,8
do 2,j=1,5
if(x.eq.pst(i,j))then
write(*,*)'x=',x,'i=',i,'j=',j
endif
2 continue
1 continue
end
parameter(nm=8,nu=5)
character kc(10),x
data kc/'Fortran','English','Mao@deng',
+'Water resource','Materials','tiyu',
+'jisuan','xingshi','dizhi','***'/
integer pst(nm,nu)
write(*,*)'enter x=?'
read(*,*) x
do 10,i=1,nm
pst(i,1)=i
10 continue
do 15,i=1,nu
pst(1,i)=i
15 continue
do 20,i=1,nm
do 30,j=1,nu
pst(i,j)=pst(1,j)*pst(i,1)
30 continue
20 continue
do 25,i=1,4
pst(i,1)=1
25 continue
pst(5,1)=2
pst(6,1)=2
pst(7,1)=3
pst(8,1)=3
do 35,i=1,4
pst(i,2)=4
35 continue
do 45,i=5,8
pst(i,2)=5
45 continue
pst(1,3)=3
pst(2,3)=3
pst(3,3)=6
pst(4,3)=6
pst(5,3)=7
pst(6,3)=7
pst(7,3)=10
pst(8,3)=10
do 50,i=1,4
pst(i,4)=2
50 continue
pst(5,4)=7
pst(6,4)=7
pst(7,4)=4
pst(8,4)=4
do 55,i=5,8
pst(i,5)=9
55 continue
pst(3,5)=5
pst(4,5)=5
pst(1,5)=8
pst(2,5)=8
write(*,100)
do 40,i=1,8
write(*,200)(pst(i,j),j=1,5)
40 continue
100 format(/2x,' ~@/@~ ~@/@~ ~@/@~ ~@/@~ ~@/@~')
200 format(/2x,20i4)
do 1,i=1,8
do 2,j=1,5
if(x.eq.pst(i,j))then
write(*,*)'x=',x,'i=',i,'j=',j
endif
2 continue
1 continue
end