Var
a,b,c,d,K:integer;
begin
write('Введите a,b,c,d: ');
readln(a,b,c,d);
K:=0;
if a>0 then K:=K+1;
if b>0 then K:=K+1;
if c>0 then K:=K+1;
if d>0 then K:=K+1;
writeln(a,' ',b,' ',c,' ',d,' K=',K);
end.
Тестовое решение:
Введите a,b,c,d: -4 5 3 0
-4 5 3 0 K=2