|
|
back to boardAC Pascal Posted by Dima 9 Nov 2011 15:45 var a,b,c,d,e,f,g,r,v:integer; begin while(true)do begin read(a); r:=a+1; v:=a-1; b:=r mod 10; c:=(r mod 100) div 10; d:=(r mod 1000) div 100; e:=r div 100000; f:=(r div 10000)mod 10; g:=(r div 1000)mod 10; if (b+c+d=e+f+g) then begin write('Yes') ; break;end; b:=v mod 10; c:=(v mod 100) div 10; d:=(v mod 1000) div 100; e:=v div 100000; f:=(v div 10000)mod 10; g:=(v div 1000)mod 10; if (b+c+d=e+f+g) then write('Yes') else write('No'); break; end; end. Edited by author 09.11.2011 15:46 |
|
|