SAVFOREVER
01.04.2022 22:31

Продвижения стартапа достоинства недостатки

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Данил6270
03.10.2021 21:45
//Как-то громоздко получилось, но я так вижу. Эх, выходные.
const n=5;
var a:array[1..n] of integer;
b:array[0..8] of integer;
ar:array[1..n] of integer;
i,c,j:integer;
begin
randomize;
writeln('Array:');
for i:=1 to n do
begin
a[i]:=random(8);
write(a[i]:4);
end;
for i:=1 to n do
 begin;
  for j:=0 to 8 do
    if a[i]=j then inc(b[j]);
 end;
for i:=1 to n do
 begin;
  for j:=0 to 8 do
   if (b[j]>1) and (a[i]=j) then a[i]:=9;
 if a[i]<>9 then
  begin;
   inc(c);
   ar[c]:=a[i];
  end;
 end;
 writeln;
 for i:=0 to 8 do writeln(i,'=',b[i]);
writeln;
writeln('Final array:');
for i:=1 to n do
if a[i]=9 then a[i]:=0;

for i:=1 to c do
begin;
 a[i]:=ar[i];
 write(a[i]:4);
end;
end.
0,0(0 оценок)
Ответ:
hiordi
28.08.2021 09:58
Код#include <iostream>constexpr double bites_to_megabytes(double a) {    return a / 8388608;}constexpr double megabytes_to_gigabytes(double a) {    return a / 1024;}int main() {    long long a;    short type;    bool is_correct = false;    double answer;    do {        std::cin >> a;        std::cout << "[1] Megabytes \n"                  << "[2] Gigabytes \n"                  << "Convert to [1] or [2]: ";        std::cin >> type;        if (type == 1 or type == 2) {            is_correct = true;        } else {            std::cout << "Meh. Try to type again. \n" << std:: endl;        }    } while (!is_correct);    switch (type) {        case 1:            answer = bites_to_megabytes(a);            break;        case 2:            answer = megabytes_to_gigabytes(bites_to_megabytes(a));            break;    }    std::cout << "An answer of conversion is " << answer << std::endl;    return 0;}
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота