albina24061980
17.12.2021 05:53

Расчтичать таблицу значений функции f(x, y) =x в квадрате - y в квадрате, где x меняется от - 2 до 3 с шагом 0,25, а y от 0 до 2 с шагом 0,1. Результаты отражать с тремя знаками после запятой.​

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
helpme163
18.10.2022 09:26
Var
A,S,n:integer;
Begin
WriteLn('Введите целое число');
ReadLn(A);
S:=0;
n:=0;
While A<>0 do
   Begin
   S:=S+A mod 10;
   n:=n+1;
   A:= A div 10
   End;
WriteLn('Sr = ',S/n);
End.

Var
A,S:integer;
Begin
WriteLn('Введите целое число');
ReadLn(A);
S:=0;
While A<>0 do
   Begin
   if (A mod 10) mod 3 = 0 then S:=S+A mod 10;
   A:=A div 10
   End;
WriteLn('S = ',S);
End.

Var
A,m:integer;
Begin
WriteLn('Введите целое число');
ReadLn(A);
m:=9;
While A<>0 do
   Begin
   if A mod 10 < m then m:= A mod 10;
   A:=A div 10
   End;
WriteLn('Min = ',m);
End.
0,0(0 оценок)
Ответ:
moon2536
09.02.2020 10:29

Задание 1:

using namespace std;

#include <iostream>

#include <clocale>

#include <cstdlib>

#include <iomanip>

#include <string>

#include <ctime>

int main() {

setlocale(LC_ALL, "rus");

system("chcp 1251");

srand(time(0));

 

int N = rand() % 6 + 5;

int pos = 0, neg = 0, max = -20, min = 20, maxind, minind;

int* mass = new int[N];

cout << "Массив:" << endl;

for (int i = 0; i < N; i++) {

 mass[i] = rand() % 41 - 20;

 if (mass[i] > 0) pos++;

 if (mass[i] < 0) neg++;

 if (mass[i] > max) {

  max = mass[i];

  maxind = i;

 }

 if (mass[i] < min) {

  min = mass[i];

  minind = i;

 }

 cout << setw(3) << mass[i];

}

cout << endl << endl;

if (pos > neg) {

 swap(mass[maxind], mass[minind]);

 cout << "Измененный массив:" << endl;

 for (int i = 0; i < N; i++) {

  cout << setw(3) << mass[i];

 }

}

else cout << "Массив не изменился";

cout << endl;

 

delete[] mass;

system("pause");

return 0;

}

Задание 2:

using namespace std;

#include <iostream>

#include <clocale>

#include <cstdlib>

#include <iomanip>

#include <string>

#include <ctime>

int main() {

setlocale(LC_ALL, "rus");

system("chcp 1251");

srand(time(0));

 

int N = rand() % 6 + 5;

int max = -20, min = 20, maxind, minind;

int* mass = new int[N];

cout << "Массив:" << endl;

for (int i = 0; i < N; i++) {

 mass[i] = rand() % 41 - 20;

 if (mass[i] > max) {

  max = mass[i];

  maxind = i;

 }

 if (mass[i] < min) {

  min = mass[i];

  minind = i;

 }

 cout << setw(3) << mass[i];

}

cout << endl << endl;

if (abs(minind - maxind) == 1) {

 cout << "Измененный массив:" << endl;

 for (int i = 0; i < N; i++) {

  if (mass[i] < 0) mass[i] = 0;

  cout << setw(3) << mass[i];

 }

}

else cout << "Массив не изменился";

cout << endl;

 

delete[] mass;

system("pause");

return 0;

}

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