//PascalABC.NET //Версия 3.3, сборка 1627 begin var a:=ReadString(); write(a.SkipLast(3).Select(x->x.ToDigit()).Sum()=a.Skip(3).Select(x->x.ToDigit()).Sum()); end.
Var a,sum1,sum2,i:longint; begin Readln(a); for i:= 1 to 3 do begin sum1 := sum1 + a mod 10; a:= a div 10; end; for i:= 1 to 3 do begin sum2 := sum2 + a mod 10; a:= a div 10; end; if (sum1 = sum2) then Writeln('YES') else Writeln('NO'); end.
//Версия 3.3, сборка 1627
begin
var a:=ReadString();
write(a.SkipLast(3).Select(x->x.ToDigit()).Sum()=a.Skip(3).Select(x->x.ToDigit()).Sum());
end.
a,sum1,sum2,i:longint;
begin
Readln(a);
for i:= 1 to 3 do
begin
sum1 := sum1 + a mod 10;
a:= a div 10;
end;
for i:= 1 to 3 do
begin
sum2 := sum2 + a mod 10;
a:= a div 10;
end;
if (sum1 = sum2) then Writeln('YES')
else Writeln('NO');
end.
Пример:
123321
YES