i942627
28.03.2022 06:42

Какие задачи, решемые техническими системами, можно рассматривать как проявление ИИ?​

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
daniilkornev05
11.04.2022 13:09
1. "Школьное" решение

// 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 оценок)
Ответ:
DAMALOVE
29.06.2020 17:52
Class OftenChar{
 public static void main(String args[]){
  java.util.Scanner in = new java.util.Scanner(System.in);
  String string = in.nextLine(); char chars[] = new char[4];
  chars[0] = in.nextLine().charAt(0); chars[2] = in.nextLine().charAt(0);
  for(int sChar = 0; sChar<string.length(); sChar++)
   if(string.charAt(sChar)==chars[0])chars[1]++;
   else if(string.charAt(sChar)==chars[2])chars[3]++;
  System.out.print("\n"+(chars[1]==chars[3]?chars[0]+""+chars[2]:chars[1]>chars[3]?chars[0]:chars[2]));
 }
}
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота