Jater

Nikita_listed_type

Nov 27th, 2012
86
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. type
  2.     month = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec);
  3. var
  4.     k: 1..366;
  5.     d: 1..31;
  6.     m: month;
  7.     m1:1..12;
  8.     i: integer;
  9. begin
  10.     Write('day month: ');
  11.     ReadLN(d,m1);
  12.     k:=1;
  13.     for m:=Jan to Dec do
  14.     begin
  15.         case m of
  16.             Jan: k:=k+0;
  17.             Mar, May, Jul, Aug, Oct, Dec: k:=k+31;
  18.             Apr, Jun, Sep, Nov: k:=k+30;
  19.             Feb: k:=k+29;
  20.         end;
  21.     if ord(m)=m1-1 then break;
  22.     end;
  23. Writeln('Poryadkovyi nomer dnya: ',k+d-1);
  24. readln;
  25. End.
RAW Paste Data