begin cls; readln(n); for i:=1 to n do begin readln(ch); a:=ch div 1000; //1 b:=ch mod 10; //4 c:=(ch div 100) mod 10; //2 d:=(ch div 10) mod 10; //3 if ((a+b)=(c+d)) then writeln('Chislo podhodiv = ',ch) else writeln('Chislo ne podhodiv = ',ch); end; readln; end.
var a, b, c,d,ch,n,i: integer;
begin
cls;
readln(n);
for i:=1 to n do
begin
readln(ch);
a:=ch div 1000; //1
b:=ch mod 10; //4
c:=(ch div 100) mod 10; //2
d:=(ch div 10) mod 10; //3
if ((a+b)=(c+d)) then
writeln('Chislo podhodiv = ',ch)
else
writeln('Chislo ne podhodiv = ',ch);
end;
readln;
end.