※ 引述《Laoda245566 (草莓獸)》之銘言:
: integer x, y, sum
: real mean
: open(unit=1,file='Gradeold.txt')
: read(1,*)x,y
: sum=0
: do i=1,62
: sum=sum+y
: end do
: mean=sum/62
: write(*,*)"mean",mean
: end
: 請問一下
: 哪裡打錯了
: 我怎麼執行都是100
: 感謝
Program Test1
implicit none
integer x,i
real mean, y(1000), sum
open(unit=1,file='Gradeold.txt')
do i=1,62
read(1,*) x,y(i)
end do
sum=0
do i=1,62
sum=sum+y(i)
end do
mean=sum/62
write(*,*)"mean",mean
stop
end program
待業中無聊一Po