Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Long-year/Nascom-BASIC/long-year.basic
Normal file
20
Task/Long-year/Nascom-BASIC/long-year.basic
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
10 REM Long year
|
||||
20 REM FNM7(N)=MOD(N,7)
|
||||
30 DEF FNM7(N)=N-7*INT(N/7)
|
||||
40 REM FNWD(Y)=Weekday of Y-12-31, 0 Sunday
|
||||
50 DEF FND(Y)=Y+INT(Y/4)-INT(Y/100)+INT(Y/400)
|
||||
60 DEF FNWD(Y)=FNM7(FND(Y))
|
||||
70 REM FNLY(Y)=Nonzero if Y is long
|
||||
80 DEF FNLY(Y)=(4=FNWD(Y))OR(3=FNWD(Y-1))
|
||||
90 CLS
|
||||
100 PRINT "**** ";
|
||||
110 PRINT "List of ISO long years";
|
||||
120 PRINT " ****"
|
||||
130 INPUT "Start year";S
|
||||
140 INPUT "End year";E
|
||||
150 PRINT
|
||||
160 FOR Y=S TO E
|
||||
170 IF FNLY(Y) THEN PRINT Y;
|
||||
180 NEXT Y
|
||||
190 PRINT
|
||||
200 END
|
||||
Loading…
Add table
Add a link
Reference in a new issue