SaveText.Ru

Без имени
  1. var
  2. n,i,j,r,p1,p2,m5,m,m7,m35,x,p:integer;
  3. begin
  4.   readln(n);
  5.   m:=0; m5:=0; m7:=0; m35:=0;
  6.   for i:=1 to n do
  7.   begin
  8.    
  9.     if (x mod 5 = 0) and (x > m5) and (x mod 7 <> 0) then
  10.       m5:=x;
  11.     if (x mod 7 = 0) and (x > m7) and (x mod 5 <> 0) then
  12.       m7:=x;
  13.     if (x mod 35 = 0) and (x > m35) then
  14.     begin
  15.       if m35 > m then m := m35;
  16.         m35 :=x;
  17.       end
  18.       else if x > m then m := x;
  19.     end;
  20.   readln(r);
  21.   r1:=1;
  22.   if (m5 * m7 > r1) and (m5 <> 0) and (m7 <> 0) then
  23.     if (m35*m > r1) and (m35 <> 0) and (m <> 0) then
  24.  writeln('Computed checksum: ', r1);
  25.  if r1 = r then writeln('Checksum control: pass')
  26.  else writeln('Checksum control: fail');
  27. end.

Share with your friends:

Print