Created
December 6, 2009 21:06
-
-
Save anonymous/250416 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var dani:array[1..7] of integer; | |
| n,dan,i,godina,leap,mesec:integer; | |
| begin | |
| readln(n); | |
| dan:=0; | |
| n:= n + 1900; | |
| for godina:=1900 to n do | |
| begin | |
| case godina of | |
| 1900,2000,2100,2200:leap:=godina mod 400; | |
| else leap:= godina mod 4; | |
| end; | |
| if leap=0 | |
| then leap:=29 | |
| else leap:=28; | |
| for mesec:=1 to 12 do | |
| case mesec of | |
| 1,3,5,7,8,10,12: for i:=1 to 31 do | |
| begin | |
| if dan=7 | |
| then dan:=1 | |
| else dan:=dan+1; | |
| if i=13 then dani[dan]:=dani[dan]+1; | |
| end; | |
| 2: for i:=1 to leap do | |
| begin | |
| if dan=7 | |
| then dan:=1 | |
| else dan:=dan+1; | |
| if i=13 then dani[dan]:=dani[dan]+1; | |
| end; | |
| 4,6,9,11:for i:=1 to 30 do | |
| begin | |
| if dan=7 | |
| then dan:=1 | |
| else dan:=dan+1; | |
| if i=13 then dani[dan]:=dani[dan]+1; | |
| end; | |
| end; | |
| end; | |
| write(dani[6],' ',dani[7]); | |
| for i:=1 to 5 do write(' ',dani[i]) | |
| end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment