Sum of the digits of n is substring of n: Difference between revisions
Sum of the digits of n is substring of n (view source)
Revision as of 19:29, 15 April 2021
, 3 years ago→{{header|BASIC}}: fix the bugs
(added Perl programming solution) |
Not a robot (talk | contribs) (→{{header|BASIC}}: fix the bugs) |
||
Line 43:
=={{header|BASIC}}==
<lang basic>10 DEFINT I,J,K
20 FOR I=0 TO 999
30 J=0: K=I
40 IF K>0 THEN J=J+
42 J$=STR$(J): J$=RIGHT$(J$,LEN(J$)-1)
50 IF INSTR(I$,J$) THEN PRINT I,
60 NEXT I</lang>
{{out}}
<pre> 0 1 2 3 4
5 6 7 8 9
</pre>
=={{header|C}}==
|