freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

fortran程序的設(shè)計(jì)復(fù)習(xí)試題與答案(編輯修改稿)

2025-07-20 22:58 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 閱讀下列FORTRAN程序:program exampleimplicit none real a,b,ans character operator read(*,*) a read(*,(A1)) operator read(*,*) b select case(operator) case(39。+39。) ans = a+b case(39。39。) ans = ab case(39。*39。) ans = a*b case(39。/39。) ans = a/b case default write(*,(39。Unknown operator 39。,A1)) operator stop end select write(*,(,A1,39。=39。,)) a,operator,b,ans stopend運(yùn)行上述程序時(shí),如果從鍵盤輸入 100回車?回車200回車則最后輸出的結(jié)果為: Unknown operator ? 閱讀下列FORTRAN程序:program exampleimplicit none integer i integer strlen integer, parameter :: key = 2 character(len=20) :: string write(*,*) Encoded string: read(*,*) string strlen = len_trim(string) do i = 1, strlen string(i:i) = char( ichar(string(i:i)) + key ) end do write(*,(39。String:39。,A20)) string stopendBCDIJK回車則最后輸出的結(jié)果為: DEFKLM 閱讀下列FORTRAN程序: program exampleimplicit none integer i,j do i=1, 2 do j=2, 3, 2 write(*, (I2,I2)) i,j end do write(*,*) another circle end do stopend程序運(yùn)行的結(jié)果是: 1 2 another circle 2 2 another circle (按輸出格式,2前均有一空格。若題目無特殊說明,不需表達(dá)出;若有說明,則空格用“□”表示)閱讀下列FORTRAN程序:program exampleimplicit none integer :: dest = 6 integer floor do floor=1, dest if ( floor==2 .or. floor==4 ) cycle write(*,*) floor end do stopend程序運(yùn)行的結(jié)果是: 1 3 5 6 閱讀下列FORTRAN77程序:program exampleimplicit none integer, parameter :: limit=10 integer counter integer :: ans = 0 counter = 1 do while( counter = limit ) ans = ans + counter counter = counter + 2 end do write(*,*) ans stopend程序運(yùn)行的結(jié)果是: 25 閱讀下列FORTRAN程序:program exampleimplicit none integer, parameter :: students = 5 integer :: student(students) = (/ 80, 90, 85, 75, 95 /) integer i do while( .true. ) write(*,*) Query: read(*,*) i if ( i=0 .or. istudents ) exit write(*,*) student(i) end do stopend運(yùn)行上述程序時(shí),如果從鍵盤輸入 3回車則最后輸出的結(jié)果為: 85 閱讀下列FORTRAN程序:program exampleimplicit none integer, parameter :: L=2, M=3, N=2 real :: A(L,M) = (/ 1,2,3,4,5,6/) real :: B(M,N) = (/ 1,2,3,4,5,6/) real :: C(L,N) integer :: i,j,k do i=1,L do j=1,N C(i,j) = do k=1,M C(i,j) = C(i,j)+A(i,k)*B(k,j) end do e
點(diǎn)擊復(fù)制文檔內(nèi)容
職業(yè)教育相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1