PROGRAM Privet;
VAR
x:real;
BEGIN
writeln('Который час?'); read(x);
if x > 24 then
writeln('Введенное число не является временем ' )
else
begin
if (x>=8) and (x<12) then writeln('Доброе утро!');
if (x>=12) and (x<17) then writeln('Добрый день!');
if(x>=17) and (x<23) then writeln('Добрый вечер!');
if(x>=23) or (x<8) then writeln('Доброй ночи!');
end;
end.
//вторая программа
var
x,x1,x2,y,y1,y2:real;
begin
write('x = '); readln(x);
write('y = '); readln(y);
write('x1 = '); readln(x1);
write('y1 = '); readln(y1);
write('x2 = '); readln(x2);
write('y2 = '); readln(y2);
if ((x - x1) * (x - x2) < 0) and ((y - y1) * (y - y2) < 0) then
writeln('Точка принадлежит заданной области')
else
writeln('Точка не принадлежит заданной области');
end.
Объяснение:
1. 10100111₂=1·2⁷+0·2⁶+1·2⁵+0·2⁴+0·2³+1·2²+1·2¹+1·2⁰=128+32+4+2+1=167₁₀
ответ: 167.
2. 10101010₂=1·2⁷+0·2⁶+1·2⁵+0·2⁴+1·2³+0·2²+1·2¹+0·2⁰=128+32+8+2=170₁₀
242₈=2·8²+4·8¹+2·8⁰=128+32+2=162₁₀
4₁₆=4·16⁰=4₁₀
10101010₂-242₈+4₁₆=170₁₀-162₁₀+4₁₀=12₁₀
ответ: 12.
3. 101011₂=1·2⁵+0·2⁴+1·2³+0·2²+1·2¹+1·2⁰=32+8+2+1=43₁₀
250₈=2·8²+5·8¹+0·8⁰=128+40=168₁₀
716₈=7·8²+1·8¹+6·8⁰=448+8+6=462₁₀
101011₂+250₈+716₈=43₁₀+168₁₀+462₁₀=673₁₀
ответ: 673.
4. 10101011₂=1·2⁷+0·2⁶+1·2⁵+0·2⁴+1·2³+0·2²+1·2¹+1·2⁰=128+32+8+2+1=171₁₀
250₈=2·8²+5·8¹+0·8⁰=128+40=168₁₀
5₁₆=5·16⁰=5₁₀
10101011₂-250₈+5₁₆=171₁₀-168₁₀+5₁₀=8₁₀
ответ: 8.
Program test1;
Var c:integer;
Begin
Readln (c);
if c<0 then
c:=c+10
else
if c>0 then
c:=c-10
else
write('число равно 0');
write(c)
End.
Program test2;
Var a,b:integer;
Begin
Readln (a,b);
if a<b then
b:=b-a
else
if a>b then
a:=a-b;
write(a,' ',b)
End.
Program test3;
Var r:integer;
Begin
Readln (r);
if r>=180 then
write('высокий')
else
write('нормальный')
End.