Nessmikk13
15.11.2021 09:51

Указать традиции предков произведения вересковый мед

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Yutik
19.05.2023 02:18
//1)
Type
ty=array[1..25] of integer;

Var
n,i:integer;
ar:ty;

procedure sortbutmeh(var ar:ty;n:integer);
Var
i,j,c:integer;
begin
for i:=1 to n-1 do
for j:=i+1 to n do
if ar[i]<ar[j] then
begin
c:=ar[i];
ar[i]:=ar[j];
ar[j]:=c;
end;
end;

begin
randomize;
readln(n);
writeln('First array:');
for i:=1 to n do
begin
ar[i]:=random(100);
write(ar[i]:4);
end;
sortbutmeh(ar,n);
writeln;
writeln('Array after sortbutmeh()');
for i:=1 to n do
write(ar[i]:4);
end.

//2)
Var
n:integer;

procedure ned(n:integer);
begin
case n of 
1:writeln('Понедельник');
2:writeln('Вторник');
3:writeln('Среда');
4:writeln('Четверг');
5:writeln('Пятница');
6:writeln('Суббота');
7:writeln('Воскресенье');
end;
end;

begin
readln(n);
ned(n);
end.

//3)
Var
s:string;

function lengthbutmeh(s:string):integer;
begin
while pos(' ',s)<>0 do
delete(s,pos(' ',s),1);
lengthbutmeh:=length(s);
end;

begin
readln(s);
writeln(lengthbutmeh(s));
end.
0,0(0 оценок)
Ответ:
inkara8
13.12.2020 12:28

using System;

internal class Program {

   private static void Main() {

       Console.WriteLine("Введите минимум для счетчика");

       var min = int.Parse(Console.ReadLine() ?? throw new ());

       Console.WriteLine("Введите максимум для счетчика");

       var max = int.Parse(Console.ReadLine() ?? throw new ());

       Console.WriteLine("Введите значение для счетчика");

       var v = int.Parse(Console.ReadLine() ?? throw new ());

       var counter = new Counter(max, min, v);

       Console.WriteLine("Введите + для увеличение и - для уменьшения, иное для выхода");

       do {

           var c = Console.ReadKey();

           if (c.KeyChar == '+') counter.Increase();

           else if (c.KeyChar == '-') counter.Decrease();

           else break;

           Console.WriteLine($" => {counter.Value}");

       } while (true);

       Console.ReadKey();

   }

}

public class Counter {

   public readonly int Maximum;

   public readonly int Minimum;

   public int Value { private set; get; }

   public Counter(int maximum, int minimum, int counter) {

       this.Maximum = maximum;

       this.Minimum = minimum;

       counter = Math.Min(this.Maximum, counter);

       counter = Math.Max(this.Minimum, counter);

       this.Value = counter;

   }

   private Counter() {

       this.Maximum = 10;

       this.Minimum = 0;

       this.Value = 5;

   }

   public void Increase() {

       var value = this.Value + 1;

       if (value > this.Maximum || value < this.Minimum)

           return;

       this.Value++;

   }

   public void Decrease() {

       var value = this.Value - 1;

       if (value > this.Maximum || value < this.Minimum)

           return;

       this.Value--;

   }

}

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