Домашняя работа по информатике
Вариант 19
Program Num1;
uses crt;
var
V, S,H, d,a:real;
begin
clrscr;
write(‘Vvedite H=’); readln(H);
write(‘Vvedite d=’); readln(d);
a:=d/sqrt(2);writeln;
S:=a*a;
V:=(1/3)*S*H;
writeln(‘V=’,V:7:2);
writeln(‘S=’,S:7:2);
readkey;
end.
Program Num2;
uses crt;
var
a, b:real;
S, P,L:real;
begin
clrscr;
write(‘Vvedite chisla ‘);read(a, b);
if a>b then begin S:=a;
writeln(‘Pervoe chuslo=’,S:7:0);end
else begin P:=a;
writeln(‘Pervoe chislo’,P:7:0);
L:=b;
writeln(‘Vtoroe chislo’,L:7:0);end;
readkey;
end.
Program Num3;
uses crt;
var
a, b,c, P,O:integer;
begin
clrscr;
writeln(‘Vvedite 3 tselyh chisla’);
readln(a, b,c);
P:=0;
O:=0;
if a>0 then P:=P+1 else if a<0 then O:=O+1;
if b>0 then P:=P+1 else if b<0 then O:=O+1;
if c>0 then P:=P+1 else if c<0 then O:=O+1;
writeln(‘Kolichestvo polozhitelnyh=’,P:7);
writeln(‘Kolichestvo otritsatelnyh=’,O:7);
readkey;
end.
Program Num4;
uses crt;
var
f, x:real;
begin
clrscr;
write(‘Vvedite x ‘);
readln(x);
if x<=0 then f:=sin(x) else if (x>0) and (x<1) then f:=1 else f:=ln(x);
writeln(‘f=’,f:7:2);
readkey;
end.