x2311

Untitled

Jun 18th, 2021
63
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Богдан Пархомерко
  2. //3 задание https://docs.google.com/document/d/1qdBKGyqQ32n9_ndA_WfWzdSZ2QTadSNnsCGg6fvSXZk/edit
  3.  
  4. function sum(a, b) {
  5. let sum = 0 //
  6. for (let i = 0; i <= b; i++) {
  7. if (i % 5 == 0 || i % a == 0 || i % b == 0) sum += i;
  8. }
  9. for (let i = 0; i < a; i++) {
  10. if (i % 5 == 0 || i % a == 0 || i % b == 0) sum -= i;
  11. }
  12. return sum
  13. }
  14.  
  15. console.log(sum(4, 10))
RAW Paste Data