Коляну

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
var
c, count, a, b, p: integer;
tmp: byte;
BEGIN
write('-> '); count:=0;
repeat
read(c);
if (c<>0) then begin
a:=abs(c); p:=0; tmp:=0;
repeat
tmp:=tmp+1;
b:=a mod 10; a:=a div 10;
if (b mod 2=0) then p:=p+1
else p:=p-1;
until (a=0);
if (tmp mod 2>0) then p:=0;
if (p=0) or (tmp=1) then count:=count+1;
end;
until (c=0);
writeln(count);
END.