Професионална програма
Loading...
+ Нов въпрос
willystyle avatar willystyle 2314 Точки
function solve(num) {
    let sum = 0;
    let result = '';
    for (let i = 1; i <= num; i++) {
        i = i.toString();
        for (let j = 0; j < i.length; j++) {
            sum += Number(i[j]);
        }
        result =
            sum === 5 ||
            sum === 7 ||
            sum === 11;
        console.log(result ? `${i} -> True` : `${i} -> False`);
        sum = 0;
    }
}

 

0
ivan91vr avatar ivan91vr 2 Точки

Благодаря!

1
dZf1aeA-Byram avatar dZf1aeA-Byram 7 Точки

The SoftUni Software University project was founded with the idea of ​​an innovative and modern educational center that creates true professionals in the world of programming. We can't read about uk bestessays review. For us, as well as the software industry as a whole, real practical skills are the most important.

0
1