VitalyD

Untitled

May 25th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.98 KB | None | 0 0
  1. var
  2.   mass: array [1..1000] of integer;
  3.  
  4.   count, balbal, maxcount:integer;
  5.   i, j, n:integer;
  6.   kontr:integer;
  7.  
  8. begin
  9.   Readln (n);
  10.   for i:=1 to n do
  11.     Readln (mass[i]);
  12.  
  13.   for i:=1 to n do
  14.      Write (mass[i]:4);
  15.   Writeln ();
  16.   Writeln ('---------------------');
  17.   for i:=1 to n do
  18.     for j:=2 to n do
  19.     begin
  20.       if (mass[i] = mass[j]) then break;
  21.      
  22.       count := mass[i] + mass[j];
  23.       if (count mod 3 = 0) then balbal := count
  24.       else break;
  25.      
  26.       if (balbal > maxcount) then maxcount := balbal;
  27.     end;
  28.  
  29.  
  30. if (maxcount = 0) then
  31.   begin
  32.     Writeln ('Программа завершена. Контроль не пройден. ');
  33.     exit;
  34.   end;
  35.  
  36. Writeln ('Введите контрольное значение');
  37. Readln (kontr);
  38.  
  39.  
  40. if (kontr = maxcount) then
  41.   begin
  42.     Writeln ('Контроль пройден')
  43.   end
  44.  
  45.   else
  46.   begin
  47.     Writeln ('Контроль не пройден');
  48.   end;
  49. end.
Advertisement
Add Comment
Please, Sign In to add comment