作者sjgau (sjgau)
看板Fortran
標題Re: F90 的 "hello, world!"
時間Tue Sep 9 09:24:02 2008
! 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