Задача 1 Room Painting Judge ЕРОР
function solve(input) { const boxesOfPaint = Number(input[0]); const rollsOfWallpaper = Number(input[1]); const pricePerGlovesPair = Number(input[2]); const pricePerBrush = Number(input[3]); const paintPrice = 21.50; const wallpaperPrice = 5.20; const glovesPercentage = 0.35; const brushesPercentage = 0.48; const deliveryPercentage = 1 / 15; const neededGloves = Math.ceil(rollsOfWallpaper * glovesPercentage); const neededBrushes = Math.floor(boxesOfPaint * brushesPercentage); const totalCost = (boxesOfPaint * paintPrice) + (rollsOfWallpaper * wallpaperPrice) + (neededGloves * pricePerGlovesPair) + (neededBrushes * pricePerBrush); const deliveryCost = totalCost * deliveryPercentage; console.log(`This delivery will cost ${deliveryCost.toFixed(2)} lv.`); } solve([10, 100, 1.20, 5.50]); Това ми излиза:
/tmp/ExecutionStrategies/l1n4yxjv.4hm/tmpvekVf1.tmp:100 solve([10, 100, 1.20, 5.50]) ^^^^^ SyntaxError: Unexpected identifier at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) at internal/main/run_main_module.js:17:47