Commit 2c1ddc96 authored by Nurasyl's avatar Nurasyl

finished

parent 53c4a99b
let answer = "";
let arr = [];
let total = 0;
while(answer !== null) {
answer = prompt("Введите число:");
if(isNaN(parseInt(answer))) {
alert("Не число!");
} else {
if(answer > 0 && answer <= 100) {
arr.push(answer);
} else {
alert("Не то число!");
};
};
};
for(let i = 0; i < arr.length; i++) {
total += parseInt(arr[i]);
};
alert(`
Кол-во чисел: ${arr.length}.
Сред. ариф. - ${total / arr.length}
`);
\ No newline at end of file
!
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="./JS/index.js"></script>
<title>Document</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment