Advertisement
bai_onzi

Untitled

Feb 9th, 2023
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.30 KB | Source Code | 0 0
  1. let x = +gets();
  2. let y = +gets();
  3. let t = +gets();
  4.  
  5. for(let i = x; i <= y; i++){
  6.     let firstN = Number(i.toString().charAt(0));
  7.     let secondN = Number(i.toString().charAt(1));
  8.     let thirdN = Number(i.toString().charAt(2));
  9.     if(firstN+secondN+thirdN === t){
  10.         console.log(i)
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement