主题:菜鸟求救大哥大姐帮忙看看谢谢····
parameter(nm=9)
integer pst(nm,nm)
write(*,*)'enter x=?'
read(*,*) x
do 10,i=1,nm
pst(i,1)=i
pst(1,i)=i
10 continue
do 20,i=1,nm
do 30,j=1,nm
pst(i,j)=pst(1,j)*pst(i,1)
30 continue
20 continue
write(*,100)
write(*,*)' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
do 40,i=1,9
write(*,200)(pst(i,j),j=1,9)
40 continue
100 format(/2x,' ~@/@~ A MULTIPLICATION TABLE ~@/@~')
write(*,*)' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
200 format(/2x,20i4)
write(*,*)' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
write(*,300)((pst(i,j),j=1,nm),i=1,nm)
i=1
j=1
do 50 while(x.ne.pst(i,j).and.i.lt.9.and.j.lt.9)
i=i+1
j=j+1
50 continue
if(x.eq.pst(i,j))then
write(*,300) x,i,j
else
write(*,*)x,'could not be find'
endif
300 format(/2x,i4,/,i,i4,4x,j,i4)
end
编辑一个小学的9*9乘法表,然后输入一个数查找这个数在表中的位置?
integer pst(nm,nm)
write(*,*)'enter x=?'
read(*,*) x
do 10,i=1,nm
pst(i,1)=i
pst(1,i)=i
10 continue
do 20,i=1,nm
do 30,j=1,nm
pst(i,j)=pst(1,j)*pst(i,1)
30 continue
20 continue
write(*,100)
write(*,*)' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
do 40,i=1,9
write(*,200)(pst(i,j),j=1,9)
40 continue
100 format(/2x,' ~@/@~ A MULTIPLICATION TABLE ~@/@~')
write(*,*)' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
200 format(/2x,20i4)
write(*,*)' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
write(*,300)((pst(i,j),j=1,nm),i=1,nm)
i=1
j=1
do 50 while(x.ne.pst(i,j).and.i.lt.9.and.j.lt.9)
i=i+1
j=j+1
50 continue
if(x.eq.pst(i,j))then
write(*,300) x,i,j
else
write(*,*)x,'could not be find'
endif
300 format(/2x,i4,/,i,i4,4x,j,i4)
end
编辑一个小学的9*9乘法表,然后输入一个数查找这个数在表中的位置?