[Fortran] 纯文本查看 复制代码 character*6,dimension(:),allocatable::xh
integer,dimension(:,:),allocatable::usual,final
integer,dimension(:),allocatable::zong
integer,dimension(:),allocatable::mingci
integer,dimension(:,:),allocatable::m(11),s(n)
integer i,j
print *,"请输入学生人数"
read *,n
allocate(xh(n))
allocate(usual(n),fianl(n))
allocate(zong(n))
do i=1,n
read *,xh(i)
end do
do i=1,n
zong(i)=usual(i)*0.3+final(i)*0.7
do j=1,n
zong(j)=usual(j)*0.3+final(j)*0.7
enddo
enddo
data m/11*0/
read(*,*)(s(i),i=1,n)
do i=1,n
if(s(i)<=100.and.s(i)>=0)then
k=s(i)/10+1
m(k)=m(k)+1
end if
end do
write(*,*)m
mingci=1
do i=1,n
do j=1,n
if (zong(i)<zong(j))then
mingci(i)=mingci(i)+1
end if
end do
end do
print *,zong(i),mingci(i)
end
上边那个定义的n有问题,怎么改
|