作者sjgau (sjgau)
看板Fortran
标题F90 的 "hello, world!"
时间Mon Sep 8 06:18:41 2008
! 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
1F:→ sjgau:因为 integer, default 是 4- 个 bytes, 最大只能到 09/08 06:24
2F:→ sjgau:-2147483648 ... +2147483647 09/08 06:24