add cycle automation

This commit is contained in:
Костя 2025-07-02 19:30:35 +03:00
parent 6428289c60
commit ef7410dd10
1 changed files with 24 additions and 10 deletions

View File

@ -23,21 +23,35 @@
// || - OR // || - OR
// ! // !
function SUMMA (chislo: number){ function SUMMA (chislo: number, chisloP: number){
let result = chislo; let funcres = chislo;
if (chislo / 3 == 1 || chislo / 3 == 2 || chislo / 3 == 3 || chislo / 5 == 1 ){ //условие если переменная chislo делиться на 3 или на 5 то вывод на экран //if (chislo / 3 == 1 || chislo / 3 == 2 || chislo / 3 == 3 || chislo / 3 == 4 || chislo / 5 == 1 ){ //пример кода статичный
let array: number [] = [result]; //массив if (chislo / 3 >=1 && chislo / 3 == chisloP ){ //условие если переменная chislo делиться на 3 или на 5 то вывод на экран
let array: number []= [funcres]; //массив
console.log(array); console.log(array);
} }
} }
for(let index = 1; index < 10; ){ for(let index = 1; index < 10; ){
SUMMA(index); SUMMA(index, index - 2 );
index = index +1; index = index +1;
} }
/*
console.log(`===================`)
const numbers = [funcres];
let sum = 0;
for (const num of numbers) {
sum += num;
}
console.log(sum); */
// Вывод: 15
//console.log(`summa of numbre <1000: ${result}`); //console.log(`summa of numbre <1000: ${result}`);