Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var n,i,one,two,three, four, five,sum:longint;
- is_any:Boolean;
- begin
- is_any:=False;
- readln(n);
- for i:=1 to 100000 do
- begin
- if i=10000 then one:=1;
- two:=(i div 1000) mod 10;
- three:=(i div 100) mod 10;
- four:=(i mod 100) div 10;
- five:=i mod 10;
- sum:=(one+two+three+four+five);
- if ((sum*n)=i) then
- begin
- writeln(i);
- is_any:=True;
- break;
- end;
- end;
- if not is_any then writeln(0);
- end.
Add Comment
Please, Sign In to add comment