Задача № 1:
program optimal_ves;
var
h,w:integer;
f,g:text;
begin
assign(f,'input.txt');
reset(f);
read (f, h);
read (f, w);
close (f);
assign (g,'output.txt');
rewrite (g);
If (h-w=100) then
write (g, 'OPTIMUM');
If (h-w<100) then
write (g, 'FAT')
else
write (g, 'THIN');
close (g);
end.
Задача № 2.
Program blok_shema;
label 1;
var
s,d,n:integer;
begin
s:=1;
d:=2;
n:=289;
1: If (n>=d) then
begin
if (n mod d = 0) then
s:=s+d;
d:=d+1;
goto 1;
end;
Writeln('d=',d);
end.
Задача № 3.
program ljagushka;
var
k,t,p,i:integer;
f,g:text;
begin
assign(f,'input.txt');
reset(f);
read (f, k);
read (f, t);
close (f);
p:=0;
For i:=1 to t do begin
if ((i<=k) and (p>=0)) then p:=p+1
else p:=p-1;
writeln ('p[',i,']=',p);
end;
assign (g,'output.txt');
rewrite (g);
write (g, p);
close (g);
end.
program optimal_ves;
var
h,w:integer;
f,g:text;
begin
assign(f,'input.txt');
reset(f);
read (f, h);
read (f, w);
close (f);
assign (g,'output.txt');
rewrite (g);
If (h-w=100) then
write (g, 'OPTIMUM');
If (h-w<100) then
write (g, 'FAT')
else
write (g, 'THIN');
close (g);
end.
Задача № 2.
Program blok_shema;
label 1;
var
s,d,n:integer;
begin
s:=1;
d:=2;
n:=289;
1: If (n>=d) then
begin
if (n mod d = 0) then
s:=s+d;
d:=d+1;
goto 1;
end;
Writeln('d=',d);
end.
Задача № 3.
program ljagushka;
var
k,t,p,i:integer;
f,g:text;
begin
assign(f,'input.txt');
reset(f);
read (f, k);
read (f, t);
close (f);
p:=0;
For i:=1 to t do begin
if ((i<=k) and (p>=0)) then p:=p+1
else p:=p-1;
writeln ('p[',i,']=',p);
end;
assign (g,'output.txt');
rewrite (g);
write (g, p);
close (g);
end.
Комментариев нет:
Отправить комментарий