hayatuzun00
02.06.2022 05:04

Проаналізуй і запиши відповідь, якщо a=7;b=13

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Диана8909
10.02.2020 22:56
// PascalABC.NET 3.0, сборка 1073
const
  sb='bcdfgjklmnpqrstvwxz';
  s='Computer programming is a process of computer programs creation';
var
  i,n:integer;
  s1,sn,t:string;
begin
  i:=1;
  while s[i]<>' ' do Inc(i);
  s1:=Copy(s,1,i-1);
  n:=Length(s); i:=n;
  while s[i]<>' ' do Dec(i);
  sn:=Copy(s,i+1,n-i);
  t:='';
  for i:=1 to Length(s1) do
    if Pos(s1[i],sb)>0 then t:=t+s1[i];
  s1:=t;
  t:='';
  for i:=1 to Length(sn) do
    if Pos(sn[i],sb)>0 then t:=t+sn[i];
  sn:=t;
  t:='';
  for i:=1 to Length(s1) do
    if Pos(s1[i],sn)>0 then
      if Pos(s1[i],t)=0 then t:=t+s1[i];
  for i:=1 to Length(t) do Write(t[i],' ');
  Writeln
end.
 
Тестовый прогон:
t r

2. "Нормальное" решение

// PascalABC.NET 3.0, сборка 1073
const
  sb='bcdfgjklmnpqrstvwxz';
  s='Computer programming is a process of computer programs creation';
begin
  var a:=s.ToWords(' ');
  a[0].Intersect(a[a.Length-1]).Where(x->Pos(x,sb)>0).Println(',')
end.

Тестовый прогон:
t,r
0,0(0 оценок)
Ответ:
EmilN304
30.04.2022 16:06
Программа может выглядеть так:

uses Crt;
const n=10;
type Mas=array [1..n] of integer;
var A: Mas;
    i, temp, MinInd, MaxInd, Max, Min: integer;
begin
ClrScr;
Randomize;
for i:=1 to  n do
   begin
   A[i]:=10+random(90);
   Write (A[i]:5);
   end;
WriteLn;
Max:=A[1]; MaxInd:=1;
Min:=A[1]; MinInd:=1;
for i:=2 to n do
begin
  if A[i]<Min then
     begin
       Min:=A[i];
       MinInd:=i;
     end
     else
       if A[i]>Max then
       begin
       Max:=A[i];
       MaxInd:=i;
     end;
end;
 temp:=A[MaxInd];
 A[MaxInd]:=A[MinInd];
 A[MinInd]:=temp;
 WriteLn;WriteLn;
 for i:=1 to  n do
   Write (A[i]:5);
 WriteLn;
 ReadLn;
end.
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота