aiD2
Var sum, k,n,i:integer; begin readln(k,n); sum:=0; for i:=k to n do sum:=sum+i*i ; writeln(sum); end. №2 var k,n,i:integer; begin readln(k,n);
for i:=1 to n do write(k, ' '); end.
3333333333 var pol,otr,nul,a,n,i:integer; begin readln(n); pol:=0; otr:=0; nul:=0;
for i:=1 to n do begin readln(a); if a=0 then nul:=nul+1; if a>0 then pol:=pol+1; if a<0 then otr:=otr+1; end; writeln(nul); writeln(otr); writeln(pol); end.
dashadomracheva
Program zadacha1; uses crt; var s, c, i, k, n: integer; begin clrscr; repeat write ('vvedite k, n: '); readln (k, n) until k<n; s:=0; for i:=k to n do begin c:=sqr(i); s:=s+c; end; writeln (s); readkey; end.
program zadacha2; uses crt; var n, k, i: integer; begin clrscr; repeat write ('vvedite k, n: '); readln (k, n) until n>0; for i:=1 to n do writeln (k); readkey; end.
program zadacha3; uses crt; var n, c, i, count1, count2, count3: integer; begin clrscr; write ('vvedite n: '); readln (n); count1:=0; count2:=0; count3:=0; for i:=1 to n do begin write ('vvedite chislo: '); readln (c); if c>0 then count1:=count1+1 else if c<0 then count2:=count2+1 else count3:=count3+1; end; writeln ('kolichestvo chisel>0 - ', count1); writeln ('kolichestvo chisel<0 - ', count2); writeln ('kolichestvo chisel=0 - ', count3); readkey; end.
Answers & Comments
begin
readln(k,n);
sum:=0;
for i:=k to n do
sum:=sum+i*i ;
writeln(sum);
end.
№2
var k,n,i:integer;
begin
readln(k,n);
for i:=1 to n do
write(k, ' ');
end.
3333333333
var pol,otr,nul,a,n,i:integer;
begin
readln(n);
pol:=0;
otr:=0;
nul:=0;
for i:=1 to n do
begin
readln(a);
if a=0 then nul:=nul+1;
if a>0 then pol:=pol+1;
if a<0 then otr:=otr+1;
end;
writeln(nul);
writeln(otr);
writeln(pol);
end.
uses crt;
var s, c, i, k, n: integer;
begin
clrscr;
repeat write ('vvedite k, n: ');
readln (k, n) until k<n;
s:=0;
for i:=k to n do begin
c:=sqr(i);
s:=s+c;
end;
writeln (s);
readkey;
end.
program zadacha2;
uses crt;
var n, k, i: integer;
begin
clrscr;
repeat write ('vvedite k, n: ');
readln (k, n) until n>0;
for i:=1 to n do
writeln (k);
readkey;
end.
program zadacha3;
uses crt;
var n, c, i, count1, count2, count3: integer;
begin
clrscr;
write ('vvedite n: ');
readln (n);
count1:=0;
count2:=0;
count3:=0;
for i:=1 to n do begin
write ('vvedite chislo: ');
readln (c);
if c>0 then count1:=count1+1
else if c<0 then count2:=count2+1
else count3:=count3+1;
end;
writeln ('kolichestvo chisel>0 - ', count1);
writeln ('kolichestvo chisel<0 - ', count2);
writeln ('kolichestvo chisel=0 - ', count3);
readkey;
end.