Advertisement
AlexeySychev

Untitled

Apr 14th, 2020
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Program zadacha2;
  2.  
  3. Var a:array[1..5,1..7] of integer;
  4.  
  5. I,j,s1,n,s2: integer;
  6. Begin
  7.  
  8. Randomize;
  9.  
  10. s1:=0;
  11. s2:=0;
  12. n:=0;
  13. For i:=1 to 5 do
  14.  
  15. Begin
  16.  
  17. For j:=1 to 7 do
  18.  
  19. begin
  20.  
  21. A[I,j]:=5+random(15-(5+1));
  22. Write(a[I,j]:3);
  23. if (a[i,j] mod 2) = 0 then
  24. begin
  25. n:=n+1;
  26. s1:= a[i,j] + s1;
  27. end;
  28.  
  29. End;
  30.  
  31. Writeln;
  32.  
  33. End;
  34. s2:= trunc(s1/n);
  35. For i:=1 to 5 do
  36. For j:=1 to 7 do
  37. begin
  38. if a[i,j] > s2 then
  39. begin
  40. writeln(a[i,j]);
  41. end;
  42. End;
  43. End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement