[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
[Fortran] 纯文本查看 复制代码
program test0504
implicit none
integer year
write(*,*) "Please input the yaer:"
read(*,*) year
if((mod(year,4)==0).or.(mod(year,100)==0.and.mod(year,400)==0)) then
write(*,*) "This year is a leap yaer."
else
write(*,*) "This year is not a leap yaer."
end if
end program test0504
[Fortran] 纯文本查看 复制代码
program test0504
implicit none
integer year
write(*,*) "Please input the yaer:"
read(*,*) year
if((mod(year,400)==0).or.(mod(year,100)/=0.and.mod(year,4)==0)) then
write(*,*) "This year is a leap yaer."
else
write(*,*) "This year is not a leap yaer."
end if
stop
end program test0504