Var i,j,s,n:integer;
begin
readln(n);
for i := 1 to n-1 do
begin
s:=0;
for j := 1 to (i div 2) do
if i mod j=0 then s:=s+j;
if s=i then write(i,' ');
end;
end.
1) Г
2) Странный вопрос, но вроде Б
3) Г
4) В
S = input("Введите Фамилия, Отчество Имя:\n")
s1 = s[0:s.find(",")]+s[s.rfind(" "):len(s)]+s[s.find(" "):s.rfind(" ")]
print(s1)
Пример:
<span>Введите Фамилия, Отчество Имя:
Иванов, Сидорович Прохор
Иванов Прохор Сидорович</span>
Uses crt;
const N=30;
var a:array [1..N] of integer;
x,min,max,t:integer;
begin
for x:=1 to N do
begin
write('a[',x,']:');
readln(a[x]);
end;
min:=1; max:=1;
for x:=1 to N do
begin
if a[x]<a[min] then min:=x;
if a[x]>a[max] then max:=x;
end;
t:=a[max];
a[max]:=a[min];
a[min]:=t;
for x:=1 to N do
write(a[x]:4);
end.