Jump to content

Sum of the digits of n is substring of n: Difference between revisions

→‎{{header|ALGOL W}}: spell isContained properly...
m (added whitespace and highlighting, added related tasks.)
(→‎{{header|ALGOL W}}: spell isContained properly...)
Line 261:
else begin
integer tPower, v, u;
logical isContanedisContained;
% find the lowest power of 10 that is greater then t %
tPower := 10;
Line 269:
v := v div 10
end while_v_gt_9 ;
isContanedisContained := false;
v := abs t;
u := abs s;
while not isContanedisContained and u > 0 do begin
isContanedisContained := ( u rem tPower ) = v;
u := u div 10
end while_not_isContaned_and_u_gt_0while_not_isContained_and_u_gt_0 ;
isContanedisContained
end containsDigits ;
% find and show the matching numbers up to 1000 %
3,060

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.