Cls input n dim a(n) s=0 for i=1 to n input a(i) next i for i=1 to n if a(i)> 0 then s=s+1 next i if s> 0 then p=1: t=0 dim b(s) for i=1 to s for j=p to n t=t+1 if a(j)> 0 then b(i)=a(j) goto 1 next j 1: p=t next i for i=1 to s for j=1 to s if b(i)< b(j) then swap b(i),b(j) next j next i for i=1 to s print b(i); next i end if
Спасибо
Ответ дал: Гость
program xxx;
var s : string;
а : integer;
begin
writeln ('введите слово-');
readln (s);
а: = length(s)
writeln ('длина слова=', a);
readln
end.
Ответ дал: Гость
type
person=record
fam: string;
imya: string;
day: integer;
end;
var
a: array[1..50] of person;
i,n,z: integer;
begin
write('n='); readln(n);
for i: =1 to n do
begin
write('fam-'); readln(a[i].fam);
write('imya-'); readln(a[i].imya);
write('day-'); readln(a[i].day);
end;
write('z-'); readln(z);
for i: =1 to n do
if a[i].day=z then writeln (a[i].fam, ' ',a[i].imya);
Популярные вопросы