PROGRAM AliceGame2 USE mod_subs IMPLICIT NONE INTEGER :: iyear0, imonth0, iday0, iyear, imonth, iday INTEGER :: ileap, ndays, idays ! WRITE(*, *) "input birth date : Year, Month, Day" READ(*, *) iyear0, imonth0, iday0 ! WRITE(*, *) "input days " READ(*, *) ndays ! ndays = ndays + iday0 iyear = iyear0 DO IF ( qleapyear(iyear) ) THEN ileap = 2 idays = 366 ELSE ileap = 1 idays = 365 END IF IF ( ndays - idays > 0 ) THEN iyear = iyear + 1 ndays = ndays - idays ELSE EXIT END IF END DO
17 名前:5 [2006/01/27(金) 22:00:19 ]
! imonth = imonth0 DO IF ( ndays - ndays_of_month(imonth, ileap) > 0 ) THEN imonth = imonth + 1 ndays = ndays - ndays_of_month(imonth, ileap) ELSE EXIT END IF END DO iday = ndays WRITE(*, *) "The date is ", iyear, imonth, iday STOP END PROGRAM AliceGame2