F90 的 "hello, world!"

看板Fortran作者 (sjgau)時間15年前 (2008/09/08 06:18), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串1/2 (看更多)
! CF0610.f90 ! ! FUNCTIONS: ! CF0610 - Entry point of console application. ! ! Example of displaying 'Hello World' at execution time. ! !**************************************************************************** ! ! PROGRAM: CF0610 ! ! PURPOSE: Entry point for 'Hello World' sample console application. ! !**************************************************************************** program CF0610 implicit none integer a, b, c a= 5 b= 6 c= a*b print *, 'Hello World', c end program CF0610 ! 如果 a= 50000, b= 60000, c= a*b ! 會得到 錯誤的答案 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.231.132.82

09/08 06:24, , 1F
因為 integer, default 是 4- 個 bytes, 最大只能到
09/08 06:24, 1F

09/08 06:24, , 2F
-2147483648 ... +2147483647
09/08 06:24, 2F
文章代碼(AID): #18n5D2dN (Fortran)
討論串 (同標題文章)
文章代碼(AID): #18n5D2dN (Fortran)