Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- q = 15;
- var
- mas: array [1..q] of integer;
- i, n, indmax, max, min, indmin: integer;
- begin
- for i:=1 to q do
- mas[i] := StrToInt(StringGrid1.Cells[i-1,0]);
- max:=mas[1];
- for i:=1 to q-1 do
- begin
- if mas[i]>max then
- max:=mas[i];
- indmax:=i;
- min:=1;
- for n:=2 to n do
- if mas[i]<mas[min] then
- min := 1;
- end;
- Memo1.Clear;
- Memo1.Lines.Add('Сумма наибольшего и наименьшего элемента в массиве= '+IntToStr(max+min));
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement