Advertisement
niepok

poniedziałki 1

Jan 25th, 2015
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.53 KB | None | 0 0
  1. program poniedzialki_1;
  2.   const mies: array[1..12] of byte = (31,28,31,30,31,30,31,31,30,31,30,31);
  3.   var r,d,t,i: integer;
  4. begin
  5.  
  6.    r := 2007;
  7.    d := 1;
  8.    t:=0;
  9.  
  10.    repeat
  11.      for i:=1 to 12 do
  12.      begin
  13.  
  14.         if (d mod 7 = 1) then
  15.         begin
  16.                 writeln('1.',i,'.',r);
  17.                 inc(t);
  18.         end;
  19.  
  20.         d := d + mies[i];
  21.  
  22.         if ((i = 2) and (r mod 4 = 0)) then inc(d);
  23.  
  24.      end;
  25.  
  26.      inc(r);
  27.  
  28.  
  29.    until r = 2017;
  30.  
  31.    writeln('Ilosc poniedzialkow: ',t);
  32.    readln;
  33. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement