С помощью Паскаля НАЙТИ СУММУ:
1/1+1/2+1/3...1/n
program P1;usescrt;varn,i : integer;summ : real;begin
clrscr;
write('N = '); read(n);
summ := 0;
for i := 1 to n do summ := summ + 1/i;
writeln('Otvet: ',summ);
readln; readln;
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
program P1;
uses
crt;
var
n,i : integer;
summ : real;
begin
clrscr;
write('N = ');
read(n);
summ := 0;
for i := 1 to n do
summ := summ + 1/i;
writeln('Otvet: ',summ);
readln;
readln;
end.