Skip to content

Commit

Permalink
Merge pull request #2 from Elias5757/master
Browse files Browse the repository at this point in the history
1.1 и 1.2 решены
  • Loading branch information
jsru-1 authored Sep 26, 2024
2 parents 0dff318 + 1097b3e commit b71cb18
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions 0-module/1-task/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
function sum(m, n) {
// ваш код...
}
const result = n+m;
return result; }
12 changes: 10 additions & 2 deletions 1-module/1-task/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
function factorial(n) {
// ваш код...
}
let i = 1;
let result = 1;

while (i <= n) {
result *= i++;
}

return result;

}
9 changes: 7 additions & 2 deletions 1-module/2-task/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ function print(text) {
* чтобы функция sayHello работала корректно
*/
function isValid(name) {
// ваш код...
if (!name) return false;
if (name.length < 4 || name.includes(" ")) {
return false;
} else {
return true;
}
}

function sayHello() {
Expand All @@ -21,4 +26,4 @@ function sayHello() {
} else {
print('Некорректное имя');
}
}
}

0 comments on commit b71cb18

Please sign in to comment.