Нати номера тех элементов массива , значение которых больше заданного числа C
Var c,n,k,i:integer; a:array[1..1000] of integer; begin write('Write size array: '); readln(n); write('Write c: '); readln(c); k:=0; for i:=1 to n do begin read(a[i]); if a[i]>c then inc(k); end; writeln(k); readln; readln end.
var c,n,,i:integer; a:array[1..1000] of integer; begin write('Write size array: '); readln(n); write('Write c: '); readln(c); for i:=1 to n do begin read(a[i]); if a[i]>c then write(a[i],' '); end; readln; readln end.
Исправилошибку
c,n,i:integer; a:array[1..1000] of integer; begin write('Write size array: '); readln(n); write('Write c: '); readln(c); for i:=1 to n do begin read(a[i]); if a[i]>c then write(a[i],' '); end; readln; readln end.
Я тупой)
var c,n,i:integer; a:array[1..1000] of integer; begin write('Write size array: '); readln(n); write('Write c: '); readln(c); for i:=1 to n do read(a[i]); for i:=1 to n do if a[i]>c then write(a[i],' '); readln; readln end.