implicit double precision (a-h,o-z)
dimension A(10), B(11)
DATA A/1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 68.0, 8.0, 9.0, 10.0/
write(*,*) 'enter p'
read(*,*) p
write(*,*) 'enter k'
read(*,*) k
do i=1,11
if(i.GE.1.AND.i.lE.k-1) then
B(i)=A(i)
endif
B(k)=p
if(i.GE.k+1.AND.i.lE.11) then
B(i)=A(i-1)
endif
enddo
write(*,*) B
stop
end
No comments:
Post a Comment