кристина2155
07.10.2020 05:52

напишите программный код по данной блок-схеме


напишите программный код по данной блок-схеме

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
teenwolf18
13.03.2023 03:32
1)Program n_1;
var x,y,z,c:integer;
begin
readln (x,y,z);
c:=x;
if c>y then c:=y;
if c>z then c:=z;
writeln (c);
end.
2)Program n_2;
var x,y,z:integer; q,w,e:boolean;
begin
readln (x,y,z);
q:= (y>x) and (z>x);
w:= (y<x) and (y<z);
e:= (z<y) and (z<x);
if e=True then writeln (z);
if w=True then writeln (y);
if q=True then writeln (x);
end.
3)Program n_3;
var x,y,z:integer;
begin
readln (x,y,z);
if (x<y) and (x<z) then writeln (x);
if (y<x) and (y<z) then writeln (y);
if (z<y) and (z<x) then writeln (z);
end.
0,0(0 оценок)
Ответ:
SAVAAVAAS
02.09.2020 18:36
#include <iostream>
#include <iomanip>
#include <cstdlib>

using namespace std;

int main() {

  bool priz;
  int n;
  cout<< "n = ";  cin>>n;
  int *a = new int[n];
  srand(time(NULL));
  for (int i=0;i<n;i++) {
     a[i]=rand()%101-50;
     cout<<a[i]<<" ";
     if (a[i]<0) a[i] = - a[i];
  }
  cout<<endl;
//  сортировка массива
   while (priz)   
   {
      priz=false;
      for (int i=1; i<n; i++)
      if (a[i]<a[i-1]) 
         {  swap(a[i],a[i-1]);  priz=true;  }
   }
// вывод массива
   cout<<"new array"<<endl; 
   for (int i=0; i<n; i++)
      cout<<a[i]<<" ";
   cout<<endl;
   system("pause");
   return 0;
}
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота