推算大小星期
20 FOR I=1 TO 12:READ A(I):NEXT I
30 FOR I=1 TO 7:READ B$(I):NEXT I
40 FOR I=1 TO 3:READ C$(I):NEXT I
50 INPUT "****年,**月,**日";N,Y,R
60 M=N-INT(N/100)*100:Z=A(Y)+(20-INT(N/100))
70 IF M=4*INT(M/4) AND Y=1 THEN X=Z-1:GOTO 100
80 IF M=4*INT(M/4) AND Y=2 THEN X=Z-1:GOTO 100
90 X=Z
100 W=M+INT(M/4)+X+R:s=W-INT(W/14)*14
110 IF S<7 THEN 140
120 S=S-7:Q=2:IF S=0 THEN S=7:Q=3
130 GOTO 150
140 Q=3:IF S=0 THEN S=7:Q=2
150 P=N+Y/100:IF P<199403 THEN Q=1
160 PRINT N;"年";Y;"月";R;"日是星期";B$(S);"该周是";C$(Q);"星期"
170 GOTO 50
180 DATA 13,2,2,5,7,10,12,1,4,6,9,11
190 DATA 一,二,三,四,五,六,日
200 DATA 在1994年3月以前不分大小,大,小
(浙江 吴建新 陆建平)