📄 新建 文本文档.txt
字号:
10 DIM C(12), a$(6)
20 INPUT "YEAR"; Y
30 X = Y: V = 28
40 IF Y < 0 THEN 20
50 IF Y = 0 THEN END
60 S = X - 1 + INT((X - 1) / 4) - INT((X - 1) / 100) + INT((X - 1) / 400)
70 C(0) = X
80 S = S + 1
90 FOR I = 1 TO 12
100 READ K
110 IF I <> 3 THEN 190
120 IF X MOD 4 = 0 THEN 140
130 GOTO 190
140 IF X MOD 100 = 0 THEN 160
150 GOTO 180
160 IF X MOD 400 = 0 THEN 180
170 GOTO 190
180 K = K + 1: V = 29
190 S = S + K
200 M = S MOD 7
210 IF M = 0 THEN C(I) = 6 ELSE C(I) = M - 1
220 NEXT
230 FOR I = 0 TO 6
240 READ a$(I)
250 NEXT
260 L1 = 2: L2 = 38: GOSUB 610
270 PRINT TAB(39); C(0);
280 L1 = 45: L2 = 79: GOSUB 610
290 GOSUB 640: GOSUB 650
300 FOR J = 0 TO 3
310 GOSUB 640
320 FOR I = 0 TO 2
330 PRINT TAB(15 + I * 25); "("; J * 3 + I + 1; ")";
340 NEXT
350 GOSUB 650: GOSUB 640: GOSUB 650: GOSUB 640
360 GOSUB 660: GOSUB 650: GOSUB 640: GOSUB 650
370 GOSUB 400
380 NEXT J
390 L1 = 2: L2 = 79: GOSUB 610: PRINT : RESTORE 700: GOTO 20
400 X1 = 1: X2 = 1: X3 = 1
410 FOR L = 0 TO 5: GOSUB 640
420 FOR I = 0 TO 2
430 D = J * 3 + I + 1
440 IF D = 2 THEN 480 ELSE IF D = 4 THEN 470
450 IF D = 6 THEN 470 ELSE IF D = 9 THEN 470
460 IF D = 11 THEN 470 ELSE W = 31: GOTO 490
470 W = 30: GOTO 490
480 W = V
490 IF I = 0 THEN Z = X1 ELSE IF I = 1 THEN Z = X2 ELSE Z = X3
500 M = (C(D) + Z) MOD 7
510 FOR N = M TO 6
520 IF Z > W THEN 580
530 IF Z < 10 THEN PRINT TAB(N * 3 + 6 + 25 * I); : PRINT USING "##"; Z; : GOTO 550
540 PRINT TAB(N * 3 + 5 + I * 25); : PRINT USING "###"; Z;
550 Z = Z + 1
560 IF I = 0 THEN X1 = Z ELSE IF I = 1 THEN X2 = Z ELSE X3 = Z
570 NEXT N
580 NEXT I: GOSUB 650
590 NEXT L: GOSUB 640: GOSUB 650
600 RETURN
610 FOR U = L1 TO L2
620 PRINT TAB(U); "*";
630 NEXT: RETURN
640 L1 = 2: L2 = 2: GOSUB 610: RETURN
650 L1 = 79: L2 = 79: GOSUB 610: RETURN
660 FOR I = 0 TO 2
670 FOR Z = 0 TO 6
680 PRINT TAB(3 * Z + 6 + I * 25); : PRINT USING "\\"; a$(Z);
690 NEXT: NEXT: RETURN
700 DATA 0,31,28,31,30,31,30,31,31,30,31,30
710 DATA "SU","MO","TU","WE","TH","FR","SA"
Program wnl(input,output);
: label
: again;
: var
: a:char;
: i:integer;
: ran,year,all_days,all_years:integer;
: days_month,first_month:array[1..12]of integer;
: procedure display;
: var
: i,j,k,l,m,n,c,d,mm,nn:integer;
: begin
: for j:=0 to 5 do
: begin
: mm:=1;
: nn:=1;
: k:=j*2+1;
: l:=j*2+2;
: m:=first_month[k];
: n:=first_month[l];
: if m=0 then m:=7;
: if n=0 then n:=7;
: for i:=1 to 21 do write( );
: write(No.,k:2);
: for i:=1 to 32 do write( );
: writeln(No.,l:2);
: for i:=1 to 8 do write( );
: writeln(||mon|tur|wed|thr|fri|sat|sun|| ||mon|tur|wed|thr|
: fri|sat|sun||);
: write( ||);
: for c:=1 to 7 do if c$#@60;m then write( |) else
: begin
: write(mm:3,|);
: mm:=mm+1;
: end;
: write(| ||);
: for c:=1 to 7 do if c$#@60;n then write( |) else
: begin
: write(nn:3,|);
: nn:=nn+1;
: end;
: writeln(|);{the first line.}
: for d:=1 to 5 do
: begin
: write( ||);
: for c:=1 to 7 do if mm>days_month[k] then write( |) else
: begin
: write(mm:3,|);
: mm:=mm+1;
: end;
: write(| ||);
: for c:=1 to 7 do if nn>days_month[l] then write( |) else
: begin
: write(nn:3,|);
: nn:=nn+1;
: end;
: writeln(|);
: end;
: readln;
: end;
: end;
: begin{main}
: days_month[1]:=31;
: days_month[2]:=28;
: days_month[3]:=31;
: days_month[4]:=30;
: days_month[5]:=31;
: days_month[6]:=30;
: days_month[7]:=31;
: days_month[8 31;
: days_month[9]:=30;
: days_month[10]:=31;
: days_month[11]:=30;
: days_month[12]:=31;
: writeln(This program may help you to make a calender of the year yo
: u input.);
: again: year:=0;
: ran:=0;
: for i:=1 to 12 do first_month[i]:=0;
: writeln(Please input the year number:);
: readln(year);
: if (year mod 400 =0) or ((year mod 100 $#@60;>0) and (year mod 4=0)) then
: ran:=1;
: days_month[2]:=days_month[2]+ran;
: all_years:=year-1;
: all_days:=all_years+(all_years div 4)-(all_years div 100)+(all_years
: div 400);
: first_month[1]:=(all_days+1) mod 7;
: for i:=2 to 12 do first_month[i]:=(first_month[i-1]+days_month[i-1])
: mod 7;
: display;
: writeln(Press enter to continute,Ctrl+C to quit.);
: readln;
: goto again;
: end.{main}
: 2000年年历:
: This program may help you to make a calender of the year you input.
: Please input the year number:2000
: No. 1 No. 2
: ||mon|tur|wed|thr|fri|sat|sun|| ||mon|tur|wed|thr|fri|sat|sun||
: || | | | | | 1| 2|| || | 1| 2| 3| 4| 5| 6||
: || 3| 4| 5| 6| 7| 8| 9|| || 7| 8| 9| 10| 11| 12| 13||
: || 10| 11| 12| 13| 14| 15| 16|| || 14| 15| 16| 17| 18| 19| 20||
: || 17| 18| 19| 20| 21| 22| 23|| || 21| 22| 23| 24| 25| 26| 27||
: || 24| 25| 26| 27| 28| 29| 30|| || 28| 29| | | | | ||
: || 31| | | | | | || || | | | | | | ||
: No. 3 No. 4
: ||mon|tur|wed|thr|fri|sat|sun|| ||mon|tur|wed|thr|fri|sat|sun||
: || | | 1| 2| 3| 4| 5|| || | | | | | 1| 2||
: || 6| 7| 8| 9| 10| 11| 12|| || 3| 4| 5| 6| 7| 8| 9||
: || 13| 14| 15| 16| 17| 18| 19|| || 10| 11| 12| 13| 14| 15| 16||
: || 20| 21| 22| 23| 24| 25| 26|| || 17| 18| 19| 20| 21| 22| 23||
: || 27| 28| 29| 30| 31| | || || 24| 25| 26| 27| 28| 29| 30||
: || | | | | | | || || | | | | | | ||
: No. 5 No. 6
: ||mon|tur|wed|thr|fri|sat|sun|| ||mon|tur|wed|thr|fri|sat|sun||
: || 1| 2| 3| 4| 5| 6| 7|| || | | | 1| 2| 3| 4||
: || 8| 9| 10| 11| 12| 13| 14|| || 5| 6| 7| 8| 9| 10| 11||
: || 15| 16| 17| 18| 19| 20| 21|| || 12| 13| 14| 15| 16| 17| 18||
: || 22| 23| 24| 25| 26| 27| 28|| || 19| 20| 21| 22| 23| 24| 25||
: || 29| 30| 31| | | | || || 26| 27| 28| 29| 30| | ||
: || | | | | | | || || | | | | | | ||
: No. 7 No. 8
: ||mon|tur|wed|thr|fri|sat|sun|| ||mon|tur|wed|thr|fri|sat|sun||
: || | | | | | 1| 2|| || | 1| 2| 3| 4| 5| 6||
: || 3| 4| 5| 6| 7| 8| 9|| || 7| 8| 9| 10| 11| 12| 13||
: || 10| 11| 12| 13| 14| 15| 16|| || 14| 15| 16| 17| 18| 19| 20||
: || 17| 18| 19| 20| 21| 22| 23|| || 21| 22| 23| 24| 25| 26| 27||
: || 24| 25| 26| 27| 28| 29| 30|| || 28| 29| 30| 31| | | ||
: || 31| | | | | | || || | | | | | | ||
: No. 9 No.10
: ||mon|tur|wed|thr|fri|sat|sun|| ||mon|tur|wed|thr|fri|sat|sun||
: || | | | | 1| 2| 3|| || | | | | | | 1||
: || 4| 5| 6| 7| 8| 9| 10|| || 2| 3| 4| 5| 6| 7| 8||
: || 11| 12| 13| 14| 15| 16| 17|| || 9| 10| 11| 12| 13| 14| 15||
: || 18| 19| 20| 21| 22| 23| 24|| || 16| 17| 18| 19| 20| 21| 22||
: || 25| 26| 27| 28| 29| 30| || || 23| 24| 25| 26| 27| 28| 29||
: || | | | | | | || || 30| 31| | | | | ||
: No.11 No.12
: ||mon|tur|wed|thr|fri|sat|sun|| ||mon|tur|wed|thr|fri|sat|sun||
: || | | 1| 2| 3| 4| 5|| || | | | | 1| 2| 3||
: || 6| 7| 8| 9| 10| 11| 12|| || 4| 5| 6| 7| 8| 9| 10||
: || 13| 14| 15| 16| 17| 18| 19|| || 11| 12| 13| 14| 15| 16| 17||
: || 20| 21| 22| 23| 24| 25| 26|| || 18| 19| 20| 21| 22| 23| 24||
: || 27| 28| 29| 30| | | || || 25| 26| 27| 28| 29| 30| 31||
: || | | | | | | || || | | | | | | ||
: Press enter to continute,Ctrl+C to quit.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -