Вариант с вводом элементов:
Program prog;
uses crt;
var a: array [0..999] of integer;
i, k, n: integer;
begin
clrscr;
write('Размер массива n = ');
readln(n);
writeln;
for i:=1 to n do
begin
write('a[',i,'] = ');
readln (a[i]);
end;
for i:=1 to n do
if a[i] mod 2 = 0 then k:=k+1;
writeln;
writeln('Количество четных чисел k = ', k);
end.
Вариант с рандомными элементами:
Program prog;
uses crt;
var a: array [0..999] of integer;
i, k, n: integer;
begin
clrscr;
randomize;
write('Размер массива n = ');
readln(n);
writeln;
for i:=1 to n do
begin
a[i]:=random(100)-50;
writeln('a[',i,'] = ',a[i]);
end;
for i:=1 to n do
if a[i] mod 2 = 0 then k:=k+1;
writeln;
writeln('Количество четных чисел k =' , k);
end.
1)
<span>for x in range(1,10+1)<span>:
</span> n = x**2-<span>10
</span> print('x',x,'=',x,'^2 - 10 = ',n)
Пример:
x 1 = 1 ^2 - 10 = -9x 2 = 2 ^2 - 10 = -6x 3 = 3 ^2 - 10 = -1x 4 = 4 ^2 - 10 = 6x 5 = 5 ^2 - 10 = 15x 6 = 6 ^2 - 10 = 26x 7 = 7 ^2 - 10 = 39x 8 = 8 ^2 - 10 = 54x 9 = 9 ^2 - 10 = 71x 10 = 10 ^2 - 10 = 90
2)
<span>N = int(input('N = '))
suma = <span>0
</span>for i in range(6,6*N)<span>:
</span> suma += i
print("Suma =",suma)</span>
3)
<span>m = []
s = <span>0
</span>for x in range(-6,33)<span>:
</span> s += x
m.append(x)
print("Середне = ",s/len(m))
Пример:
Середне = 13.0
</span></span>
Program psck;
vara,b: real;
begin read(a,b); b:=10*10*10*10*a-3*b/5; write('Полученный результат - ',b);end.