В
Все
М
Математика
А
Английский язык
Х
Химия
Э
Экономика
П
Право
И
Информатика
У
Українська мова
Қ
Қазақ тiлi
О
ОБЖ
Н
Немецкий язык
Б
Беларуская мова
У
Українська література
М
Музыка
П
Психология
А
Алгебра
Л
Литература
Б
Биология
М
МХК
О
Окружающий мир
О
Обществознание
И
История
Г
Геометрия
Ф
Французский язык
Ф
Физика
Д
Другие предметы
Р
Русский язык
Г
География
Deiselpro1
Deiselpro1
07.08.2022 19:57 •  Информатика

');
sound(zvuk); delay(del); nosound;
readln; close(g);
halt;
End;

Procedure DAl;
Begin
writeln;
textcolor(14);
writeln(' Этап пройден успешно.');
textcolor(15);

readln; clrscr;
End;

Procedure leksika;
Begin

writeln(' 3 этап- Лексический анализ...');
writeln('> Проверка на присутствие недопустимых комбинаций знаков');

{удаляем ВСЕ пробелы из строки}
for i:= 1 to dlina do if b[i]<>' ' then s1:=s1+b[i];
writeln(s1);
dlina1:=length(s1);

{проверяем присутствие ошибочных комбинаций символов }
for i:=1 to dlina do begin
IF (

{повторяющиеся знаки}
((s1[i]='+') and (s1[i+1]='+')) or
((s1[i]='-') and (s1[i+1]='-')) or
((s1[i]='=') and (s1[i+1]='=')) or
((s1[i]=';') and (s1[i+1]=';')) or

((s1[i]='[') and (s1[i+1]='[')) or
((s1[i]=']') and (s1[i+1]=']')) or
{комбинации разных знаков }
((s1[i]='[') and (s1[i+1]='=')) or
((s1[i]='=') and (s1[i+1]='[')) or

((s1[i]='[') and (s1[i+1]=';')) or
((s1[i]=';') and (s1[i+1]='[')) or

((s1[i]='[') and (s1[i+1]=':')) or
((s1[i]=':') and (s1[i+1]='[')) or

((s1[i]=']') and (s1[i+1]=':')) or
((s1[i]=':') and (s1[i+1]=']')) or

((s1[i]='[') and (s1[i+1]='.')) or
((s1[i]='.') and (s1[i+1]='[')) or

((s1[i]='+') and (s1[i+1]='[')) or

{}
((s1[i]=']') and (s1[i+1]='=')) or
((s1[i]='=') and (s1[i+1]=']')) or

((s1[i]=';') and (s1[i+1]=']')) or

((s1[i]=']') and (s1[i+1]='.')) or
((s1[i]='.') and (s1[i+1]=']')) or

((s1[i+1] in c) and (s1[i]='.') and (s1[i-1] in bukva)) or
((s1[i+1] in c) and (s1[i]='.') and (s1[i-1] in bukva2)) or

((s1[i+1] in c) and (s1[i]='.') and
(s1[i-1] in c) and ((s1[i-2]='+') or (s1[i-2]='-'))) or

((s1[i]=']') and (s1[i+1]='+')) or
((s1[i]='+') and (s1[i+1]=']')) or

((s1[i]=']') and (s1[i+1]='-')) or
((s1[i]='-') and (s1[i+1]=']')) or
{}
((s1[i]='=') and (s1[i+1]=';')) or
((s1[i]=';') and (s1[i+1]='=')) or

((s1[i]='+') and (s1[i+1]='=')) or
((s1[i]='=') and (s1[i+1]='+')) or

((s1[i]=';') and (s1[i+1]='+')) or
((s1[i]='+') and (s1[i+1]=';')) or

((s1[i]=';') and (s1[i+1]='-')) or
((s1[i]='-') and (s1[i+1]=';')) or

((s1[i]='-') and (s1[i+1]='+')) or
((s1[i]='+') and (s1[i+1]='-')) or

((s1[i]='-') and (s1[i+1]='=')) or

((s1[i]='=') and (s1[i+1]='.')) or
((s1[i]='.') and (s1[i+1]='=')) or

((s1[i]='+') and (s1[i+1]='.')) or

((s1[i]='-') and (s1[i+1]='.')) or

((s1[i]=';') and (s1[i+1]='.')) or
((s1[i]='.') and (s1[i+1]=';'))
)

OR {AND?}
{комбинация ::= ::X :X= X:= где X-любой символ}
(
((s1[i]=':') and (s1[i+1]=':') and (s1[i+2]<>'=')) or
((s1[i]=':') and (s1[i+1]<>':') and (s1[i+2]='=')) or
((s1[i]='.') and (s1[i+1]<>'.') and (s1[i+2]='.')) { .X. }

)
then Netl;
end; {for}

{комбинация цифра' 'цифра - не допустима}
for i :=1 to dlina do
if
(
(s1[i] in c) and {(not (s1[i+1] in c)) and (s1[i+2] in c)) and }
((s1[i+1]=' ') and (s1[i+2]<>' ')) or
((s1[i+1]<>' ') and (s1[i+2]=' '))

)
and (s1[i+1]<>'.')
then NETl;

DAl;
End;

Показать ответ
Ответ:
89622356703
89622356703
06.12.2022 22:48
//Pascal ABC.NET v3.0 сборка 1111

Const
 s=5;

Var
 ar:array[1..s] of integer;
 n,m,i:integer;
begin
 writeln('N');
 readln(n);
 writeln('M');
 readln(m);
 writeln('Array:');
 for i:=1 to s do
   readln(ar[i]);
 writeln('First array:');
 for i:=1 to s do
  begin
   write(ar[i]:4);
   if ar[i] div n<>0 then ar[i]:=ar[i]+m;
  end;
 writeln;
 writeln('Final array:');
  for i:=1 to s do
   write(ar[i]:4);
end. 

Пример ввода:
3
3
1
2
3
4
5
Пример вывода:
First array:
   1   2   3   4   5
Final array:
   1   2   6   7   8

//Блок-схема во вложении
Ввести двумерный массив a. все элементы, которые при целочисленном делении на n ненулевое значение,
0,0(0 оценок)
Ответ:
st1rb1t
st1rb1t
30.05.2020 15:37
На Java:

class SearchPalin{
 public static void main(String args[]){
  String palinString = new java.util.Scanner(System.in).nextLine();
  System.out.print("\nПалиндром(-ы):\n  ");
  for(int wordStart = 0, wordEnd = 0; wordEnd<palinString.length(); wordEnd++)
   if(wordEnd+1==palinString.length() || palinString.charAt(wordEnd+1)==' '){
 String wordBeginning = "", wordEnding = "";
 for(int wordBe = wordStart;wordBe<wordEnd+1;wordBe++)wordBeginning+=palinString.charAt(wordBe);
 for(int wordEn = wordEnd;wordStart-1<wordEn;wordEn--)wordEnding+=palinString.charAt(wordEn);
 if(wordBeginning.equals(wordEnding)){
  for(int palinWord = wordStart;palinWord<=wordEnd;palinWord++)System.out.print(palinString.charAt(palinWord));
  System.out.print("\n  ");
 } wordStart = wordEnd+2;
   }
 }
}
0,0(0 оценок)
Популярные вопросы: Информатика
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота