home03_05.html 361 B

123456789101112
  1. <head></head>
  2. <body>
  3. <script>
  4. const floors = 9;
  5. const flats = 4;
  6. let flatNum = +prompt("Enter flat number");
  7. let entrance = Math.floor(flatNum / flats / floors);
  8. let floor = Math.floor((flatNum - (entrance * 36)) / flats);
  9. alert("Entrance: " + (entrance + 1) + ", Floor: " + (floor+1));
  10. </script>
  11. </body>