borisova936935

Untitled

Nov 21st, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. function exam(input) {
  2.  
  3. let n = Number(input[0]);
  4. let m = Number(input[1]);
  5. let s = Number(input[2]);
  6.  
  7. let output = ""
  8. for (let i = m; i >= n; i--) {
  9.  
  10. if (i % 2 === 0 && i % 3 === 0) {
  11. if (i === s){
  12. break;
  13. }
  14. output+= i + " "
  15. }
  16.  
  17. }
  18.  
  19. console.log(output);
  20. }
  21. exam(["20",
  22. "1000",
  23. "36"])
Advertisement
Add Comment
Please, Sign In to add comment