Re: F90 的 "hello, world!"

看板Fortran作者 (sjgau)時間15年前 (2008/09/09 09:24), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
! CF0610.f90 ! 這行是 註解 ! ----------------------------------------------- !dec$if (.false.) 這裡是 段落式的 註解,註解很重要 Hello World -1294967296 Press any key to continue ! c > +2147483647, 會得到錯誤的答案,而且沒有提供 ! 任何 compile 和 runtime 的錯誤或是 警告訊息 !dec$endif ! ----------------------------------------------- program CF0610 implicit none integer a, b, c a= 50000 b= 60000 c= a*b print *, 'Hello World', c ! c > +2147483647, 會得到錯誤的答案,而且沒有提供 ! 任何 compile 和 runtime 的錯誤或是 警告訊息 end program CF0610 ※ 引述《sjgau (sjgau)》之銘言: : ! 如果 a= 50000, b= 60000, c= a*b : ! 會得到 錯誤的答案 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.231.128.31
文章代碼(AID): #18nT0p5G (Fortran)
討論串 (同標題文章)
文章代碼(AID): #18nT0p5G (Fortran)