Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cinema(input) {
- let index = 0;
- let capacityOfHall = input[0];
- let peopleCount = input[1];
- while (capacityOfHall !== "Movie time!") {
- if (capacityOfHall === peopleCount) {
- capacityIsHall = true;
- break;
- }
- index++;
- capacityIsHall = input[index];
- }
- if (capacityIsHall === "Movie time!") {
- console.log(`There are {останали места} seats left in the cinema.`);
- } else if (capacityOfHall == capacityIsHall) {
- console.log(`The cinema is full.`);
- } else {
- console.log(`Cinema income - ${totalProfit} lv.`);
- }
- }
- cinema([60, 10, 6, 3, 20, 15, "Movietime!"]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement