Найти и исправить ошибки в программе. 4-1 proram z; var n,m: char; beginwrite(n -> ); readln(m)m: =1; while sqr(m)> =n do m: =m+1; writeln(m); end 4-2program д; beginvar i,n,k,a: integer; readln(n); k: =0; for i: =1 to n doreadln(a); if a > 0 then k: =k+1; end; wreteln(k = ',k: 0: 2); end. 4-3 program w; var max; a: integer; n: longint; beginwrite('n -> '); readln(n); max: =10; while n < > 0 begina: =n mod 10; if a > max; then max: =a; n: =n mod 10; endreadln(max); end
program Z;
var
n, m: Byte;
begin
write('n = ');
readln(n);
m:=1;
while sqr(m)>=n do m:=m+1;
writeln('M = ', m);
end.
Задача 4-2:
program D;
var
i,n,k,a: integer;
begin
write('n = ');
readln(n);
k:=0;
for i:=1 to n do
begin
readln(a);
if a > 0 then k:=k+1;
end;
wreteln('k = ', k:0:2);
end.
Задача 4-3:
program W;
var
max, a: integer;
n: longint;
begin
write('n = ');
readln(n);
max:=10;
while n <> 0 do
begin
a:=n mod 10;
if a > max then max:=a;
n:=n mod 10;
end;
readln(max);
end.