lol1039
11.01.2022 02:52

');
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;

Нажмите на рекламу ниже и сразу увидите ответ
↓
Популярные вопросы:
Ответ:
st1nk1n1p
15.07.2022 11:19
1)
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
int main()
{
string str;
getline(cin, str);
for (int i = 1; i < str.length(); i++)
{
if (i % 3 == 0)
{cout << str[i] << endl;}
}
_getch();
return 0;
}
2)
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
int main()
{ string str;
getline(cin, str);
for (int i = 1; i < str.length(); i++)
{
 if (i % 2 == 0)
 { if (str[i] != 'a')
  { str[i] = 'a'; }
  if (str[i] != 'b')
  { str[i] = 'b'; }
  if (str[i] != 'c')
  { str[i] = 'c'; }
}
}
cout << str << endl;
_getch();
return 0;}
0,0(0 оценок)
Ответ:
margoschka02
22.11.2022 06:56
1.
0,5 Кбайт = 0,5*1024 байт = 512*8 бит
512*8/128 = 32

2.
Память для одного символа = log(2)64=6 бит
Объем текста = 10*32*64*6 бит = 10*32*64*6/8 байт =
10*4*64*6/1024 Кбайт = 15 Кбайт

3.
3 Кбайт = 3*1024 байт = 3*1024*8 бит
Память для одного символа = 3*1024*8/6144 = 4 бита
Количество символов в алфавите = 2^4 = 16

4.
Память для одного символа = log(2)128=7 бит
Объем сообщения = 10*7 = 70 бит

8.
a) 3 Кбайт=3*1024 Байт = 3072 бАЙТ
b) 2 Мбайт=2*1024 Кбайт = 2*1024*1024 байт = 2*1024*1024*8 бит = 16777216 бит
c) 4,5 Гигабайт=4,5*1024 Мбайт = 4,5*1024*1024 Кбайт = 4718592 Кбайт
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота