# Boolean

:
Ïðèìåð ==> a:=2>4 ==> False;
<> - íå ðàâíî
Ôîðìàòèðîâàíûé âûâîä:
writeln(x:5:3);

if else:
Ïðèìåð 1:if (x>y) then writeln ('÷èñëî x áîëüøå') else writeln ('÷èñëî y áîëüøå');
Ïðèìåð 2:if (x>y) then
Begin
writeln ('÷èñëî x áîëüøå');
writeln('Êàêîå íèáóäü ñîîáùåíèå');
End
else
Begin
writeln ('÷èñëî y áîëüøå');
writeln('Êàêîå íèáóäü ñîîáùåíèå');
End;
Ñòðóêòóðà èñïîëüçóåòñÿ è áåç else.
Ñîñòàâíûå óñëîâèÿ:
if ((x>y) and (z>Q)) then ....
Òàêæå âîçìîæíî èñïîëçîâàíèå èñëîâèÿ ñ îïåðàòîðàì or.
Âëîæåííûå óñëîâèÿ:
if (x>y) then
Begin
if (z>2) then writeln('ñîîáùåíèå') else writeln('ñîîáùåíèå 2');
writeln ('÷èñëî x áîëüøå');
writeln('Êàêîå íèáóäü ñîîáùåíèå');
End
else
Begin
writeln ('÷èñëî y áîëüøå');
writeln('Êàêîå íèáóäü ñîîáùåíèå');
End;
Îïåðàòîð âûáîðà Case:
Ïðèìåð:
case a of
0: writeln('Íîëü');
1: writeln('Îäèí');
2: writeln('Äâà');
else writeln('×èñëî íå ñ äèàïàçîíà îò 0 äî 2');

'÷èñëî'). read(N). end.. writeln('Ñóììà ÷èñåë:'. repeat writeln(Ââåäèòå ÷èñëî). Îïåðàòîð For: for i:=1 to 5 do writeln(i). Îïåðòîð GOTO: uses .. END. else BEGIN writeln('×èñëî íå ñ äèàïàçîíà îò 0 äî 2'). 1: writeln('Îäèí'). read(Num). BEGIN metka : writeln('Ââåäèòå öèôðó'). Îïåðòîð REPEAT UNTIL(öèêëè÷åñêèé). i:=i+1. . s:=S+num. writeln(S). while (i<=N) do BEGIN writeln('Ââåäèòå'. until (S>=10). for i:=5 downto 1 do writeln(i).i.. i:=1. var . goto metka.S)..end. S:S+x. label metka. S:=0.. case a of 0: writeln('Íîëü'). readln(x). Îïåðàòîð while do(Öèêë): writeln('Ââåäèòå êîëè÷åñòâî ÷èñåë'). 2: writeln('Äâà'). END.

. procedure write_proc. BEGIN write_proc. end. END. BEGIN writeln(write_funct). Ñîçäàíèå ñîáñòâåííîãî ìîäóëÿ: unit modul. SumNum:integer.. var a. END.îêðàøèâàåò òåêñ â íóæíûé öâåò ==> êîäû öâåòîâ ñ 1 äî 15 â help. Ôóíêöèè: program... ×òîáû îñóùåñòâèòü ïåðåäà÷ó äàííûõ ôóíêöèè òðåáóåòñÿ óêàçàòü íóæíûå çíà÷åíèÿ â ñêîáêàõ.Òèï äàííûõ Char: Äîïóñêàåòñÿ ñðàâíèâàíèå ñòðîâ ñ äàííûì òèïîì äàííûõ òàê êàê ñðàâíåíèå èäåò ïî êîäó ñèìâîëà. procedure write_funct:string. end. writeln(local1).. Begin write_funct:='Òåêñò'. uses. Ïðîöåäóðû: program.. TextColor(12). uses. ... Ôóíêöèÿ TextColor . Begin local1:='Òåêñò'. interface uses crt.b:integer. var local1:string.

b:integer).procedure summa2(var sum: integer. a.b:integer). begin summa1:=a+b. implementation procedure summa2(var sum: integer. BEGIN sum:=a+b. function summa1(a.b:integer):integer. end. end. end. function summa1(a. Ìàññûâû Îäíîìåðíûå ìàñèâû: . a.b:integer):integer.