Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
test_hw_20
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Нұрасыл Қайратұлы
test_hw_20
Commits
2c1ddc96
Commit
2c1ddc96
authored
Dec 05, 2023
by
Nurasyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finished
parent
53c4a99b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletion
+37
-1
index.js
JS/index.js
+25
-0
index.html
index.html
+12
-1
No files found.
JS/index.js
View file @
2c1ddc96
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
index.html
View file @
2c1ddc96
!
\ 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment