');
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;
Вы не указали требуемый язык программирования, поэтому написал решение на C# , используя средства этого языка :
using System;
using System.Linq;
class MainClass
{
public static void Main(string[] args)
{
int k = 0;
int[] E = new int[7];
int[] K = new int[7];
for (int i = 0; i < 7; i++)
E[i] = Convert.ToInt32(Console.ReadLine());
for (int i = 0; i < 7; i++)
K[i] = E[i] * E[i];
Console.WriteLine("Элементы массива E : ");
foreach (int M in E)
Console.WriteLine(M);
Console.WriteLine("\nНомер минимального элемента массива K : " + Array.IndexOf(K, K.Min()));
foreach (int M in E)
if (M % 2 == 1)
k++;
Console.WriteLine("\nКоличество нечетных эелементов в массиве E : " + k);
}
}