Добавил:
bagiwow
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Программирование / Лабораторные / ЭВТ-1-Паскаль / LAB_6
.PAS Program GSA;
{ ‚뢥бвЁ в Ў«Ёжг ЁбвЁ®бвЁ ¤«п § Є® ¤Ґ Њ®аЈ }
{ ®ваЁж ЁҐ Є®моЄжЁЁ: not ( x and y ) =not x or not y}
Uses Crt,graph;
Var x,y:Boolean; { ЏҐаҐ¬ҐлҐ ¤«п ®аЈ Ё§ жЁЁ жЁЄ« Ё ўлў®¤ в Ў«Ёжл }
i:Integer; { ЏҐаҐ¬Ґ п ¤«п ®аЈ Ё§лжЁЁ жЁЄ« }
BEGIN
{ ‚뢥бвЁ в Ў«Ёжг ЁбвЁ®бвЁ ¤«п § Є® ¤Ґ Њ®аЈ }
{ ®ваЁж ЁҐ Є®моЄжЁЁ: not ( x and y ) =not x or not y}
Clrscr;
{ ЇЄ }
Textcolor(15);
For i:=1 To 78 Do Write('*'); Writeln;
Write('* X * Y *');
Textcolor(5); Write(' XandY ');
Textcolor(15); Write('*');
Textcolor(5); Write('not(XandY)');
Textcolor(15); Write('*');
Textcolor(10); Write(' notX ');
Textcolor(15); Write('*');
Textcolor(10); Write(' notY ');
Textcolor(15); Write('*');
Textcolor(10); Write('notXorNotY');
Textcolor(15); Write('*'); Writeln;
For i:=1 To 78 Do Write('*'); Writeln;
{ ’Ґ«® }
For x:=false To true Do
For y:=false To true Do Begin
If x Then Write('* ',x,' *')
Else Write('* ',x,' *');
If y Then Write(' ',y,' *')
Else Write(' ',y,' *');
If x And y Then Write(' ',x And y,' ')
Else Write(' ',x And y,' ');
Textcolor(15); Write('*'); Textcolor(5);
If Not(x And y) Then Write(' ',Not(x And y),' ')
Else Write(' ',Not(x And y),' ');
Textcolor(15); Write('*'); Textcolor(10);
If Not x Then Write(' ',Not x,' ')
Else Write(' ',Not x,' ');
Textcolor(15); Write('*'); Textcolor(10);
If Not y Then Write(' ',Not y,' ')
Else Write(' ',Not y,' ');
Textcolor(15); Write('*'); Textcolor(10);
If Not x Or Not y Then Write(' ',Not x Or Not y,' ')
Else Write(' ',Not x Or Not y,' ');
Textcolor(15); Write('*'); Writeln;
For i:=1 To 78 Do Write('*'); Writeln
End;
Textcolor(3); { “бв ®ўЄ 梥⠨§®Ўа ¦ҐЁп }
Writeln('„ЂЌЌЂџ ’ЂЃ‹€–Ђ ‚›‚…„…ЌЂ „‹џ ‡ЂЉЋЌЂ „… ЊЋђѓЂЌЂ');
Writeln('Ћ’ђ€–ЂЌ€… ЉЋЌњћЌЉ–€€: NOT(X AND Y)=NOT X OR NOT Y.');
Textcolor(13); { “бв ®ўЄ 梥⠨§®Ўа ¦ҐЁп }
Writeln('„«п ўл室 Ё§ Їа®Ја ¬¬л ¦¬ЁвҐ «оЎго Є« ўЁиг.');
Readkey;
END.
{ ‚뢥бвЁ в Ў«Ёжг ЁбвЁ®бвЁ ¤«п § Є® ¤Ґ Њ®аЈ }
{ ®ваЁж ЁҐ Є®моЄжЁЁ: not ( x and y ) =not x or not y}
Uses Crt,graph;
Var x,y:Boolean; { ЏҐаҐ¬ҐлҐ ¤«п ®аЈ Ё§ жЁЁ жЁЄ« Ё ўлў®¤ в Ў«Ёжл }
i:Integer; { ЏҐаҐ¬Ґ п ¤«п ®аЈ Ё§лжЁЁ жЁЄ« }
BEGIN
{ ‚뢥бвЁ в Ў«Ёжг ЁбвЁ®бвЁ ¤«п § Є® ¤Ґ Њ®аЈ }
{ ®ваЁж ЁҐ Є®моЄжЁЁ: not ( x and y ) =not x or not y}
Clrscr;
{ ЇЄ }
Textcolor(15);
For i:=1 To 78 Do Write('*'); Writeln;
Write('* X * Y *');
Textcolor(5); Write(' XandY ');
Textcolor(15); Write('*');
Textcolor(5); Write('not(XandY)');
Textcolor(15); Write('*');
Textcolor(10); Write(' notX ');
Textcolor(15); Write('*');
Textcolor(10); Write(' notY ');
Textcolor(15); Write('*');
Textcolor(10); Write('notXorNotY');
Textcolor(15); Write('*'); Writeln;
For i:=1 To 78 Do Write('*'); Writeln;
{ ’Ґ«® }
For x:=false To true Do
For y:=false To true Do Begin
If x Then Write('* ',x,' *')
Else Write('* ',x,' *');
If y Then Write(' ',y,' *')
Else Write(' ',y,' *');
If x And y Then Write(' ',x And y,' ')
Else Write(' ',x And y,' ');
Textcolor(15); Write('*'); Textcolor(5);
If Not(x And y) Then Write(' ',Not(x And y),' ')
Else Write(' ',Not(x And y),' ');
Textcolor(15); Write('*'); Textcolor(10);
If Not x Then Write(' ',Not x,' ')
Else Write(' ',Not x,' ');
Textcolor(15); Write('*'); Textcolor(10);
If Not y Then Write(' ',Not y,' ')
Else Write(' ',Not y,' ');
Textcolor(15); Write('*'); Textcolor(10);
If Not x Or Not y Then Write(' ',Not x Or Not y,' ')
Else Write(' ',Not x Or Not y,' ');
Textcolor(15); Write('*'); Writeln;
For i:=1 To 78 Do Write('*'); Writeln
End;
Textcolor(3); { “бв ®ўЄ 梥⠨§®Ўа ¦ҐЁп }
Writeln('„ЂЌЌЂџ ’ЂЃ‹€–Ђ ‚›‚…„…ЌЂ „‹џ ‡ЂЉЋЌЂ „… ЊЋђѓЂЌЂ');
Writeln('Ћ’ђ€–ЂЌ€… ЉЋЌњћЌЉ–€€: NOT(X AND Y)=NOT X OR NOT Y.');
Textcolor(13); { “бв ®ўЄ 梥⠨§®Ўа ¦ҐЁп }
Writeln('„«п ўл室 Ё§ Їа®Ја ¬¬л ¦¬ЁвҐ «оЎго Є« ўЁиг.');
Readkey;
END.