Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let x = +gets();
- let y = +gets();
- let t = +gets();
- for(let i = x; i <= y; i++){
- let firstN = Number(i.toString().charAt(0));
- let secondN = Number(i.toString().charAt(1));
- let thirdN = Number(i.toString().charAt(2));
- if(firstN+secondN+thirdN === t){
- console.log(i)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement