Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let key = Number(input.shift());
- let opertaion = input.shift();
- let result=""
- for (let a = 1; a <= 30; a++) {
- for (let b = 1; b <= 30; b++) {
- for (let c = 1; c <= 30; c++) {
- if (operation === "+" && (a < b < c)) {
- console.log(`${а} + ${b} + ${c} = ${key}`)
- } else if (opertaion === "*" && a > b > c) {
- console.log(`${а} * ${b} * ${c} = ${key}`)
- } else {
- console.log(`No`);
- }
- }
- }
- }
- }
- solve([12])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement