procedure sortbutmeh(var ar:ty;n:integer); Var i,j,c:integer; begin for i:=1 to n-1 do for j:=i+1 to n do if ar[i]<ar[j] then begin c:=ar[i]; ar[i]:=ar[j]; ar[j]:=c; end; end;
begin randomize; readln(n); writeln('First array:'); for i:=1 to n do begin ar[i]:=random(100); write(ar[i]:4); end; sortbutmeh(ar,n); writeln; writeln('Array after sortbutmeh()'); for i:=1 to n do write(ar[i]:4); end.
//2) Var n:integer;
procedure ned(n:integer); begin case n of 1:writeln('Понедельник'); 2:writeln('Вторник'); 3:writeln('Среда'); 4:writeln('Четверг'); 5:writeln('Пятница'); 6:writeln('Суббота'); 7:writeln('Воскресенье'); end; end;
begin readln(n); ned(n); end.
//3) Var s:string;
function lengthbutmeh(s:string):integer; begin while pos(' ',s)<>0 do delete(s,pos(' ',s),1); lengthbutmeh:=length(s); end;
cin>>Massiv[b]; } MassNullEllement(Massiv); system("PAUSE"); return EXIT_SUCCESS;}
Type
ty=array[1..25] of integer;
Var
n,i:integer;
ar:ty;
procedure sortbutmeh(var ar:ty;n:integer);
Var
i,j,c:integer;
begin
for i:=1 to n-1 do
for j:=i+1 to n do
if ar[i]<ar[j] then
begin
c:=ar[i];
ar[i]:=ar[j];
ar[j]:=c;
end;
end;
begin
randomize;
readln(n);
writeln('First array:');
for i:=1 to n do
begin
ar[i]:=random(100);
write(ar[i]:4);
end;
sortbutmeh(ar,n);
writeln;
writeln('Array after sortbutmeh()');
for i:=1 to n do
write(ar[i]:4);
end.
//2)
Var
n:integer;
procedure ned(n:integer);
begin
case n of
1:writeln('Понедельник');
2:writeln('Вторник');
3:writeln('Среда');
4:writeln('Четверг');
5:writeln('Пятница');
6:writeln('Суббота');
7:writeln('Воскресенье');
end;
end;
begin
readln(n);
ned(n);
end.
//3)
Var
s:string;
function lengthbutmeh(s:string):integer;
begin
while pos(' ',s)<>0 do
delete(s,pos(' ',s),1);
lengthbutmeh:=length(s);
end;
begin
readln(s);
writeln(lengthbutmeh(s));
end.