pascalabcnet/InstallerSamples/!Tutorial/01_First/Boolean1.pas

16 lines
408 B
ObjectPascal
Raw Permalink Normal View History

2018-10-26 20:12:42 +03:00
// Логический тип. Логические выражения с and, or и not
2015-05-14 22:35:07 +03:00
var
b: boolean;
x: integer;
begin
2018-10-26 20:12:42 +03:00
Write('Введите x (от 1 до 9): ');
Readln(x);
2015-05-14 22:35:07 +03:00
b := x=5;
2018-10-26 20:12:42 +03:00
Writeln('x=5? ',b);
2015-05-14 22:35:07 +03:00
b := (x>=3) and (x<=5);
2018-10-26 20:12:42 +03:00
Writeln('x=3,4 или 5? ',b);
2015-05-14 22:35:07 +03:00
b := (x=3) or (x=4) or (x=5);
2018-10-26 20:12:42 +03:00
Writeln('x=3,4 или 5? ',b);
2015-05-14 22:35:07 +03:00
b := not Odd(x);
2018-10-26 20:12:42 +03:00
Writeln('x - четное? ',b);
2015-05-14 22:35:07 +03:00
end.