����� �� �����.


������ ���������.

������.

��������, ���������� ��� ��� ���. ���� ������.

1. ��� ������� �� 400 -> ���������� -> �����
2. ��� ������� �� 100 -> �� ���������� -> �����
3. ��� ������� �� 4 -> ���������� -> �����
4. ��� �� ���������� -> �����
5. ��

� ��� ��� ���������� ��� ����������� ��� ������. ���� ���� - ����������. �������� ����� �� 2100 ����.

(*
���������� ��� ������ � ����������� ��������������� ����������
��� ������ � ����� �� 1996 ���� � ������.
   
Copyright (C) Sergei Frolov, 1998.                                    
v1.0  Jan, 4, 1998.

��������� ������������� �� ���������� � �����������, ����������
�� ����� ���������� ��� ������������� ����������� ���������/�������
� �������� � ��������� �������.
*)

program denned;                                                           

const                                                                    

  YEARS  : array[0.. 3] of byte = (0, 2, 3, 4);                        
  MONTHS : array[1..12] of byte = (0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5);  
  DAYOFWEEKS  : array[0..6] of string =                                  
    ('�����������', '�����������', '�������', '�����', '�������',        
     '�������', '�������');                                                

var       
                                                                
  a, b, c, d, e, f, tmp : byte;                                          
  day, month, year      : word;                                            

begin                                                                     

  repeat                                                                  

    write('����� XX -> ');
    readln(day);                                                         
    if day = 0 then break; { ����� }                                      
    write('����� XX -> ');                                               
    readln(month);                                                        
    write('��� XXXX -> ');                                               
    readln(year);                                                       
    tmp := year - 1996;                                                  
    a := tmp and 3;                                                       
    b := (tmp shr 2) + (tmp and $FC);                                     
    c := MONTHS[month];                                                 
    if (a = 0) and (month > 2) then inc(c);                             
    a := YEARS[a];                                                      
    e := (a + b + c + day) mod 7;                                      
    writeln('���������: ', DAYOFWEEKS[e]);                           
    writeln;                                                           

  until false;                                                         

end.                                                                   



����� �� ��������, � ���������� � ���������.

SpyLOG