Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
31
Task/Long-year/QuickBASIC/long-year.basic
Normal file
31
Task/Long-year/QuickBASIC/long-year.basic
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
DEFINT A-Z
|
||||
|
||||
DECLARE FUNCTION p% (Yr AS INTEGER)
|
||||
DECLARE FUNCTION LongYear% (Yr AS INTEGER)
|
||||
|
||||
DIM iYi, iYf, i
|
||||
|
||||
CLS
|
||||
PRINT "This program calculates which are 53-week years in a range."
|
||||
PRINT
|
||||
INPUT "Initial year"; iYi
|
||||
INPUT "Final year (could be the same)"; iYf
|
||||
IF iYf >= iYi THEN
|
||||
FOR i = iYi TO iYf
|
||||
IF LongYear(i) THEN
|
||||
PRINT i; " ";
|
||||
END IF
|
||||
NEXT i
|
||||
END IF
|
||||
PRINT
|
||||
PRINT
|
||||
PRINT "End of program."
|
||||
END
|
||||
|
||||
FUNCTION LongYear% (Yr AS INTEGER)
|
||||
LongYear% = (p%(Yr) = 4) OR (p%(Yr - 1) = 3)
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION p% (Yr AS INTEGER)
|
||||
p% = (Yr + INT(Yr / 4) - INT(Yr / 100) + INT(Yr / 400)) MOD 7
|
||||
END FUNCTION
|
||||
Loading…
Add table
Add a link
Reference in a new issue