[問題] 有人會這一題嗎?

看板Fortran作者 (幾樓)時間15年前 (2009/06/18 18:13), 編輯推噓-3(030)
留言3則, 3人參與, 最新討論串1/1
有人會把以下輸出嗎?? program dograde integer,parameter :: num=20, sn=5 type :: member integer :: id, psum=0 end type type :: grades integer :: sub(sn)=0 end type type(grades) :: psub(num),totalave type(member) :: person(num) open(10,file="grade.txt",form="unformatted",access="direct",recl=4*sn*num) do i=1,num person(i)%id=i read(10,rec=i) psub(i) do j=1,sn totalave%sub(j) = totalave%sub(j) + psub(i)%sub(j) person(i)%psum = person(i)%psum + psub(i)%sub(j) end do end do ! 每個人總成績 do i=1,num write(*,*) person(i)%id, person(i)%psum end do ! 各科平均 do j=1,sn write(*,*) real(totalave)/read(num) end do stop end program ps:我是用我朋友的帳號po的!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.42.218.4

06/18 18:37, , 1F
難道連輸出都不想試...未免太不想動腦了吧
06/18 18:37, 1F

06/18 19:03, , 2F
Segmentation fault
06/18 19:03, 2F

06/18 19:44, , 3F
就拿上2篇別人幫你解答的用 你乾脆重修一次比較快
06/18 19:44, 3F
文章代碼(AID): #1AEXCu-G (Fortran)
文章代碼(AID): #1AEXCu-G (Fortran)