М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации
djastin05
djastin05
23.12.2020 02:30 •  Информатика

Дан одномерный целочисленный массив состоящий из 10 элементов составьте программу определения значемния суммы наибольшего и наименьшего элементов этого массива массив заполнить любым

👇
Ответ:
// PascalABC.NET 3.0, сборка 1111
begin
  var a:=ArrRandom(10,-15,25);
  Write('Исходный массив: '); a.Println(',');
  Writeln('Сумма min+max=',a.Min+a.Max)
end.

Тестовое решение:
Исходный массив: -8,-6,15,16,17,21,9,10,-15,19
Сумма min+max=6
4,6(88 оценок)
Ответ:
s1072966
s1072966
23.12.2020
Program Project1;
var i, max, min:integer; mass:array [0..9] of integer;
begin
  randomize;
  for i:=1 to 9 do mass[i]:=Random(100);
  max:=0;
  min:=100;

  for i:=1 to 9 do begin
    if max<mass[i] then max:=mass[i];
    if min>mass[i] then min:=mass[i];
  end;

  writeln('max: ', max);
  writeln('min: ', min);
  writeln('max + min = ', max+min);
end.
4,8(22 оценок)
Открыть все ответы
Ответ:
masloshick
masloshick
23.12.2020
Romanf romanf отличник 2013-01-10t16: 13: 22+00: 00 1. подумать над алгоритмом 2. вот сам алгоритм: а. спросить у пользователя значения б. расчитать ответ в. выдать ответ на экран 3. написать код в паскале 4. исправить ошибки компиляции 5. протестировать, вводить разные числа 6. обнаружила, что если вводить числа наугад ответ получается отрицательным иногда 7. вставить код проверки введенных пользователем значений 8. убрать ошибки компиляции 9. протестировать 10. готово а вот и сама программа: program aerobus; uses crt; const totalplace = 160; var businessplaces, economyplaces: integer; businessprice, economyprice: real; totalcharge: real; a,b: integer; correctinput: boolean; begin clrscr; businessplaces: =totalplace div 4; economyplaces: = totalplace - businessplaces; writeln('business places count: ', businessplaces); writeln('economy places count: ', economyplaces); correctinput: =false; while not correctinput do begin write('please input business class ticket price: '); readln(businessprice); if(businessprice> 0) then begin correctinput: =true; end else begin writeln('the price should be a positive number, please try again'); end; end; economyprice: =businessprice/2; writeln('economy ticket price is: ', economyprice: 0: 2); correctinput: =false; while not correctinput do begin write('how many business tickets are left? : '); readln(a); if(a> =0) and (a< =businessplaces)then correctinput: =true; if(a< 0) then begin writeln('please input a positive number or 0, please try again'); end; if(a> businessplaces) then begin writeln('please input a number which is less or equal to the tolal business place count, please try again'); end; end; correctinput: =false; while not correctinput do begin write('how many economy tickets are left? : '); readln(b); if(b> =0) and (b< =economyplaces)then correctinput: =true; if(b< 0) then begin writeln('please input a positive number or 0, please try again'); end; if(b> economyplaces) then begin writeln('please input a number which is less or equal to the tolal economy place count, please try again'); end; end; totalcharge: =(businessplaces-a)*businessprice; totalcharge: =totalcharge+(economyplaces-b)*economyprice; writeln('the total charge is: ', totalcharge: 0: 2); writeln; writeln('press enter to exit'); readln; end.
4,6(13 оценок)
Ответ:
Var     n, m, sum: integer;   begin     sum : = 0;     repeat     writeln('введите числ с которого начинается ряд');     readln(n);     writeln('введите число которым заканчивается ряд');     readln(m);     until n< m;       if odd(n) then n : = n + 1;     if odd(m) then m : = m - 1;     sum : = (n + m) * (m - n + 2) div 4;     writeln('сумма чётных чисел натурального ряда: ', sum); end.
4,6(45 оценок)
Это интересно:
Новые ответы от MOGZ: Информатика
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ