|
@@ -226,10 +226,15 @@ b = (c = b/2);
|
|
|
function defineNumberFlat (floor, countFlatOnFloor, numberFlat) {
|
|
|
const countFlatInEntranse = floor * countFlatOnFloor;
|
|
|
const entranse = Math.ceil(numberFlat / countFlatInEntranse);
|
|
|
- console.log (`Number entranse ${entranse}`);
|
|
|
-
|
|
|
const floorNumber = Math.ceil((numberFlat % countFlatInEntranse) / countFlatOnFloor);
|
|
|
+
|
|
|
+ if (numberFlat % countFlatInEntranse === 0 ) {
|
|
|
+ console.log (`Number entranse ${entranse}`);
|
|
|
+ console.log (`Number floor ${numberFlat / entranse / countFlatOnFloor}`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log (`Number entranse ${entranse}`);
|
|
|
console.log (`Number floor ${floorNumber}`);
|
|
|
-
|
|
|
};
|
|
|
defineNumberFlat (9, 4, 81);
|