dbarkhatova
03.05.2020 17:46

Решите в excel, очень нужно


Решите в excel, очень нужно

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
ilyassovaalina235393
30.11.2021 11:48
Var a: array [1 .. 10] of integer;
  i, Count, C, tmpLast, tmpFirst: integer;
begin
  write('Введите число C: ');
  readln(C);
  writeln;
  for i := 1 to 10 do
  begin
    write('a[', i, '] = ');
    readln(a[i]);
    if a[i] = C then
    begin
      Count := Count + 1;
      tmpLast := i;
    end;
  end;
  writeln;
  if (Count = 0) then writeln('В массиве нет числа равное С')
  else
  begin
    writeln('В массиве нашлось число, равное С');
    if (Count = 1) then
      writeln('Первое и единственное число в позиции a[', tmpLast, ']')
    else
    begin
      i := 0;
      repeat
        i := i + 1;
        tmpFirst := i;
      until (a[i] = C);
      writeln('Первое такое число a[', tmpFirst, ']');
      writeln('Последнее такое число a[', tmpLast, ']');
    end;
  end;
  readln;
end.

Ввести число с. определить, есть ли в массиве элемент, равный с. найти • номер первого такого элемен
0,0(0 оценок)
Ответ:
bertashka
23.02.2022 02:44

#include <iostream> // header input/output streams

#include <fstream> // header для работы с файлами

using std::ifstream; // для работы с файлом input.txt

using std::ofstream; // для работы с файлом output.txt

using std::cin; // для работы cin

using std::cout; // для работы cout

using std::endl; // для работы перевода на новую строку endl

int main(){

ifstream in_file;

  ofstream out_file;

   try{

     in_file.open("input.txt");

     out_file.open("output.txt");

   }

  catch(std::exception& e){

     cout << e.what() << endl;

   }

  unsigned int a,b;

  in_file >> a >> b;

  unsigned int sum = a+b -1;

cout << sum;

  out_file << sum - a << ' ' << sum-b << endl;

}

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота