Andrew228krut
02.09.2022 16:39

Условный оператор: if(x>2)theny:=x+11elsey:=x−25.

Выбери действие, которое будет выполняться в случае истинности условия:

y:=x+11

x>2

y:=x−25

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
ed31121
22.02.2021 04:56
Sub maxZn()

'заполнение массива 
 Dim mas(20) 
S = "" 
Randomize 
For i = 1 To 20   
mas(i) = Round(Rnd(100) * 100)   
 S = S + Str(mas(i)) + "," 
 Next i

'поиск максимального числа и количества его повторений   
qty = 1 
 max = mas(1) 'предполагаем, что максимальное число в первом элементе массива   

For i = 2 To 20   

If mas(i) = max Then     
qty = qty + 1   
End If   

If mas(i) > max Then     
 max = mas(i)     
qty = 1   
 End If 
 Next i    
 MsgBox "последовательность чисел " + S 
MsgBox "максимальное число " + Str(max) + "число повторений " + Str(qty)  
End Sub

Sub test() 
 Call maxZnEnd
 Sub
Дана последовательность чисел. выяснить, сколько раз в ней встречается наибольшее число.(basic)
0,0(0 оценок)
Ответ:
Кирюха33333
04.03.2021 00:41
#1:
#include <iostream>
#include <ctime>

int main()
{
  srand(time(NULL));

  const int arraySize = 10;
  int mainArray[arraySize];  
  
  for (int i = 0; i < arraySize; i++)
    mainArray[i] = rand() % 1000;
  
  int maxNum = mainArray[0];
  for (int i = 0; i < arraySize; i++)
    if (mainArray[i] > maxNum)
      maxNum = array[i];
  
  std::cout << maxNum << std::endl;

  system("pause");
  return 0;
}

#2:
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
  float
    a_coef,
    b_coef,
    c_coef;

  cout << "Input the coefficients (a * x^2 + b * x + c): ";
  cin >> a_coef >> b_coef >> c_coef;
  
  float res1, res2;
  
  res1 = (-b_coef + sqrt(b_coef * b_coef - 4 * a_coef * c_coef)) / (2 * a_coef);
  res2 = (-b_coef - sqrt(b_coef * b_coef - 4 * a_coef * c_coef)) / (2 * a_coef);
  
  cout << res1 << "; " << res2 << endl;

  system("pause");
  return 0;
}

#3:
#include <iostream>
#include <ctime>

int main()
{
  srand(time(NULL));
  int
    unknownNumber = rand() % 100 - 50,
    attempts = 0,
    inputtedNumber;

  while (true)
  {
    attempts++;

    cout << "Input the number: ";
    cin >> inputtedNumber;
    
    if (inputtedNumber != unknownNumber)
      cout << "Incorrect answer! Try again!" << endl;
    else
      break;
  }

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