Fortran判断是否为闰年,求教老师看一下哪里出错
[Fortran] 纯文本查看 复制代码 program test0504
implicit none
integer year
write(*,*) "Please input the yaer:"
read(*,*) year
!if((mod(yaer,4.0)==0).or.(mod(yaer,100.0)==0.and.mod(yaer,400.0)==0)) then
if((yaer%4.0==0.0).or.(yaer%100.0==0.0.and.yaer%400.0==0.0)) then
write(*,*) "This year is a leap yaer."
else
write(*,*) "This year is not a leap yaer."
end if
stop
end
错误:
错误 1 error #5082: Syntax error, found REAL_CONSTANT '4.0' when expecting one of: <IDENTIFIER> [
错误 2 error #5082: Syntax error, found REAL_CONSTANT '100.0' when expecting one of: <IDENTIFIER> [
错误 3 error #5082: Syntax error, found REAL_CONSTANT '400.0' when expecting one of: <IDENTIFIER> [
错误 4 error #5082: Syntax error, found ')' when expecting one of: , (/ : ]
错误 5 Compilation Aborted (code 1)
|