CLS
k = 0
FOR i = 1000 TO 9999
s = 0: a = i: c = 0
DO WHILE a > 0
s = s + a MOD 10
a = a \ 10
c = c + 1
IF c = 2 THEN s2 = s: s = 0
IF c = 4 THEN s1 = s
LOOP
IF (s1 MOD 2 = 0) AND (s1 = s2) THEN PRINT i;: k = k + 1
NEXT i
PRINT "Kolvo chisel v kot summa 2-h levih cifr chet i ravn summe 2-h pravih cifr="; k
FOR i = 1000 TO 9999
if (i\1000+i\100 mod 10)=(i\10 mod 10+i mod 10) and (i\10 mod 10+i mod 10) mod 2=0 then print i;:k=k+1;
next
print k