Strelkov18
21.04.2021 11:37

7(A^B) and (C^A) = ?
A=1 B=0 C=0​

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Polina8Let
27.04.2020 15:12
Type
  V=array[1..11] of integer;

function FirstNegative(a:V;n:integer):integer;
var
  i:integer;
begin
  i:=0;
  Result:=0;
  repeat
    i:=i+1;
    if a[i]<0 then Result:=i
  until (Result>0) or (i>n)
end;

const
  m=8;
  n=11;
var
  a,b:V;
  i,p,q:integer;
begin
  Randomize;
  for i:=1 to m do a[i]:=random(100)-50;
  for i:=1 to n do b[i]:=random(100)-50;
  p:=FirstNegative(a,m);
  q:=FirstNegative(b,n);
  writeln('Массив А');
  for i:=1 to m do write(a[i]:5);
  writeln;
  writeln('Массив B');
  for i:=1 to n do write(b[i]:5);
  writeln;
  if p<=q then writeln('Номер первого отрицательного элемента в массива А: ',p)
  else writeln('Номер первого отрицательного элемента в массива B: ',q)
end.

Тестовый прогон:
Массив А
   37   14  -25   32   30  -29   38   27
Массив B
   33  -36   23  -17   -3  -16  -33   33  -48  -39   30
Номер первого отрицательного элемента в массива B: 2
0,0(0 оценок)
Ответ:
Kruglivnik1ta
22.11.2022 22:28
#include <iostream>
#include <iterator>
#include <algorithm>
#include <list>
using namespace std;
int main()
{
   setlocale(LC_ALL, "Rus");
    cout << "Введите список и нажмите Ctrl+Z:"<<endl;
    list<int> l;
     copy(istream_iterator<int>(cin), istream_iterator<int>(),back_inserter(l));   
     list<int>::iterator it=max_element(l.begin(), l.end());
     cout << "Максимум:"<<*it<<endl; it = min_element(l.begin(), l.end());
     cout << "Минимум:" << *it << endl;
         system("pause");
       return 0;
}
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота