Advertisement
Guest User

tapizdec

a guest
Jun 1st, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.47 KB | None | 0 0
  1. const
  2. q = 15;
  3. var
  4. mas: array [1..q] of integer;
  5. i, n, indmax, max, min, indmin: integer;
  6. begin
  7. for i:=1 to q do
  8. mas[i] := StrToInt(StringGrid1.Cells[i-1,0]);
  9. max:=mas[1];
  10. for i:=1 to q-1 do
  11. begin
  12. if mas[i]>max then
  13. max:=mas[i];
  14. indmax:=i;
  15. min:=1;
  16. for n:=2 to n do
  17. if mas[i]<mas[min] then
  18. min := 1;
  19. end;
  20. Memo1.Clear;
  21. Memo1.Lines.Add('Сумма наибольшего и наименьшего элемента в массиве= '+IntToStr(max+min));
  22. end;
  23. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement