не так уж и трудно, если
program project2;
var
n,a,b,c,i,k,max,min: longint;
inp,outp: text;
begin
assign(inp,'input.txt');
reset(inp);
assign(outp,'output.txt');
rewrite(outp);
readln(inp,n);
max: =0;
min: =0;
c: =0;
for i: =1 to n do
read(f1,a);
if i=1 then
b: =a;
if a> max then
max: =a;
k: =a-c;
c: =a;
if k< 0 then
k: =abs(k);
min: =min+k;
if k> min then
min: =k;
end;
max: =max-b;
write(outp,max,' ',min);
close(inp);
close(outp);
end.
1)
program test1;
var a:string;
i,n,f:integer;
read (a);
n:=length(a);
for i:=1 to n do begin
if (a[i]>='0') and (a[i]<='9')
then f:=f+1;
write ('Количество цифр= ',f);
2)
var i:integer;
for i:=41 to 50 do
write(i:3);
writeln;
for i:=51 to 60 do
for i:=61 to 70 do
for i:=71 to 80 do
3)
var s: string;
i: byte;
sum,c,k: integer;
sum:=0;
read(s);
for i:=1 to length(s) do
if s[i] in ['0'..'9'] then
val(s[i],c,k);
sum:=sum+c;
writeln('Сумма цифр=',sum);
не так уж и трудно, если
program project2;
var
n,a,b,c,i,k,max,min: longint;
inp,outp: text;
begin
assign(inp,'input.txt');
reset(inp);
assign(outp,'output.txt');
rewrite(outp);
readln(inp,n);
max: =0;
min: =0;
c: =0;
for i: =1 to n do
begin
read(f1,a);
if i=1 then
b: =a;
if a> max then
max: =a;
k: =a-c;
c: =a;
if k< 0 then
begin
k: =abs(k);
min: =min+k;
if k> min then
min: =k;
end;
end;
max: =max-b;
write(outp,max,' ',min);
close(inp);
close(outp);
end.
1)
program test1;
var a:string;
i,n,f:integer;
begin
read (a);
n:=length(a);
for i:=1 to n do begin
if (a[i]>='0') and (a[i]<='9')
then f:=f+1;
end;
write ('Количество цифр= ',f);
end.
2)
program test1;
var i:integer;
begin
for i:=41 to 50 do
write(i:3);
writeln;
for i:=51 to 60 do
write(i:3);
writeln;
for i:=61 to 70 do
write(i:3);
writeln;
for i:=71 to 80 do
write(i:3);
end.
3)
var s: string;
i: byte;
sum,c,k: integer;
begin
sum:=0;
read(s);
for i:=1 to length(s) do
if s[i] in ['0'..'9'] then
begin
val(s[i],c,k);
sum:=sum+c;
end;
writeln('Сумма цифр=',sum);
end.