for i: =1 to z-1 do for j: =i+1 to z do if st[i]> st[j] then
begin
t: =st[i];
st[i]: =st[j];
st[j]: =t;
end;
st[z+1]: ='-';
for i: =1 to z do i st[i]< > st[i+1] then write(st[i],' ');
end.
Ответ дал: Гость
на паскале:
program myprogram; var n,i,fact: integer; sum: real; beginsum: =0; fact: =1; writeln('введите число n.'); readln(n); for i: =1 to n dobeginfact: =fact*i; sum: =sum+1/fact; end; writeln('сумма 1/1! +1/2! +1/3! ++1/n = ',sum); end.
Ответ дал: Гость
var a: integer; c1, c2, c3, c4: integer;
begin for a : = 1000 to 9999 do begin c1 : = a div 1000; c2 : = (a div 100) mod 10; c3 : = (a div 10) mod 10; c4 : = a mod 10; if (c1 < > c2) and (c1 < > c3) and (c1 < > c4) and (c2 < > c3) and (c2 < > c4) and (c3 < > c4) then writeln(a); end; end.
Популярные вопросы