Hi there

I have written program for school work 2 times but i cant figure out the problem. First time my program didn't counted dates like 1.1.2005 - 1.1.2007

Then I fixed that by deleting small part and rewriting it but now it dont count the leap year .. i need it exactly from calendar .. 2012 .. 2016.. but its impossible task for me now. I have no time left to try it and fail gain.

Commentery and counters are in my language but it does not rly matter ...

Any kind of help with that would be lovely. Thanks.

var d1,d2,m1,m2,r1,r2,i,x,r1i,r2i: integer; mesic31, mesic30: set of byte; dni,dni2: longint; v:array[1..12] of integer; begin write('den1='); readln(d1); write('mesic1=');readln(m1); write('rok1=');readln(r1); write('den2=');readln(d2); write('mesic2=');readln(m2); write('rok2=');readln(r2); mesic31:=[1,3,5,7,8,10,12]; {mesice ktere maji 31 dni} mesic30:=[4,6,9,11]; {mesice ktere maji 30 dni} r1i:=r1;r2i:=r2; for i:=1 to 12 do begin if i in mesic31 then v

*:=31; if i in mesic30 then v**:=30; if i=2 then {unor ma 28 dni} v**:=28; end; {rozdelime program do dvou casti: dni a dni2 , dni v rozmezi jednoho roku nebo vice let} dni:=0; for i:=m1 to 12 do dni:=dni+v**; dni:=dni-d1; for i:=m2-1 downto 1 do dni:=dni+v**; dni:=dni+d2; r2:=r2-1; x:=(r2-r1) div 4; {jednou za 4 roky pridame jeden den prestupniho roku} dni:=dni+(365*(r2-r1))+x; dni2:=0; for i:=m1 to m2-1 do dni2:=dni2+v**; dni2:=dni2-d1+d2; if r1i=r2i then writeln('pocet dni je ',dni2) else writeln('pocet dni je ',dni); readln; end.*