, . Compile Compile ( Alt+F9). . , .
- , , . .
Run Run ( Ctrl+F9), , . Free Pascal.
1
.
: boolean.
.
:
2+1, x<0
Y= x-2,1, x>/2
Sinx, 0<=x<=/2
X Y(x) :
1= -2,5 2=-0,5 3=1,5
Program Func;
var
x,y:real;
BEGIN
Write( =); readln(x);
If x<0 then y:= sqr(x)+1
else
if x>pi/2 then y:= x-2.1
else
y:= sin(x);
writeln(' Y= ', : 6: 3)
END.
.
,, (<><><>0).
Program mult;
var
max,a,b,: integer;
mul: integer;
BEGIN
writeln(' 3 ,,'); readln(a,b,c);
max:= a;
if b>max then max:=b;
if c>max then max:=c;
mul:= (a *b*) div max;
writeln(' =',mul)
END.
3. 2 .
.
:
1. .
2. .
.
.
S= ( +3)/2-( +5)/4++ +35)/34- ( +35)/36
Program sum_;
var
a,i: integer;
s: 1;
BEGIN
s:=0; {}
i:=2; { }
a:=l; {}
while i< = 36 do
begin
s:=s+a*(sqrt(i)+(i+1))/i;
i:=i+2;
a:= -a
end;
writeln(s= ,s:6:2)
END.
.
:
Ex+Sin2x*cos(x-2), x<=1
Y=
2x+ ), x>1
[0,2] h
Program tab_;
const
h=0.2;
var
x: real;
BEGIN
x: =0;
while x < = (2 + h / 2) do
begin
|
|
if x < = 1 then :=exp(x) +sqr(sin(x))*s(x-2)
else
:=x(ln(2)*x)+sqrt(x+6);
writeln('x = ', x: 5: 2, ' = ', : 7: 2);
x:= x + h
end
END.
.
(, , .) (, , ).
Program data_;
type
mes= (jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec);
day=1..31;
year=1900..2010;
var
d: day;
m: ms;
g: year;
n: 1..12;
BEGIN
Write( D,N,G); readln(d,n.g);
Case n of
1:m:=jan;
2:m:=feb;
3:m:=mar;
4:m:=apr;
5:m:=may;
6:m:=jun;
7:m:=jul;
8:m:=aug;
9:m:=sep;
10:m:=oct;
11:m:=nov;
12:m:=dec;
end;
Case m of
Jan, mar, may, jul, aug, oct:
If d=31 then
begin
d:=1; m:=succ(m)
end
else
inc(d);
apr, jun, sep, nov:
f d=30 then
begin
d:=1; m:=succ(m)
end
else
inc(d);
dec:
If d=31 then
begin
d:=1; m:=jan; inc(g)
end
else
inc(d);
feb:
if ((d=28) and (not((g mod 400=0) or (g mod 4=0) and (g mod 100<>0)))
or (d=29) then
begin
d:=1; m:=mar;
end
else
inc(d);
end; {case}
writeln( : );
write(d:2);
Case m of
jan: write();
feb: write();
mar: write();
apr: write();
may: write();
jun:write();
ju1: wite();
aug: wit('');
sep:write('');
oct: write('');
nov: write('');
dec: write('');
end;
write(g:5, ' ')
END.
3.