Program chik; var a:array[1..1000]of integer; h,i,n,x:integer; begin read(n); h:=0; for i:=1 to n do begin read(a[i]); end; read(x); for i:=1 to n do begin if(a[i]=x*x)then h:=h+1; end; write(h); end. 2) program chik2; var a,h:integer; begin a:=5; h:=0; while a<>0 do begin read(a); if(a<0)then h:=h+1; end; write(h); end. 3)program chik3; var a,h,s,p:real; begin a:=5; h:=0; while a<>0 do begin read(a); s:=s+a; h:=h+1; end; p:=s/h; write(p); end. 4)program chik4; var n,j,i:longint; begin read(n); for i:=1 to n do begin for j:=1 to i do begin write(j,' '); end; writeln; end; end. УДАЧИ!
uses crt;
var i,sum,k: integer;
begin
sum: =0;
k: =0;
writeln('вводите числа. 0 - конец последовательности');
repeat
read(i);
if i mod 2=1 then begin
sum: =sum+i;
inc(k);
end;
until i=0;
writeln;
writeln('среднее арифметическое нечетных чисел: ',sum/k: 5: 3);
end.
var a:array[1..1000]of integer;
h,i,n,x:integer;
begin
read(n);
h:=0;
for i:=1 to n do
begin
read(a[i]);
end;
read(x);
for i:=1 to n do
begin
if(a[i]=x*x)then h:=h+1;
end;
write(h);
end.
2)
program chik2;
var a,h:integer;
begin
a:=5;
h:=0;
while a<>0 do
begin
read(a);
if(a<0)then h:=h+1;
end;
write(h);
end.
3)program chik3;
var a,h,s,p:real;
begin
a:=5;
h:=0;
while a<>0 do
begin
read(a);
s:=s+a;
h:=h+1;
end;
p:=s/h;
write(p);
end.
4)program chik4;
var n,j,i:longint;
begin
read(n);
for i:=1 to n do
begin
for j:=1 to i do
begin
write(j,' ');
end;
writeln;
end;
end.
УДАЧИ!