Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
dop_urok_1
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
Нұрасыл Қайратұлы
dop_urok_1
Commits
1c124f46
Commit
1c124f46
authored
Aug 09, 2024
by
Нұрасыл Қайратұлы
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил валидацию в таск 6
parent
d34cf26d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
task_6.html
task_6.html
+13
-9
No files found.
task_6.html
View file @
1c124f46
...
...
@@ -10,18 +10,22 @@
const
userAnswer
=
parseInt
(
prompt
(
'Введите кол-во секунд:'
))
console
.
log
(
`Осталось
${
userAnswer
}
секунд`
)
if
(
isNaN
(
userAnswer
)
!==
true
)
{
console
.
log
(
`Осталось
${
userAnswer
}
секунд`
)
const
hours
=
Math
.
floor
(
userAnswer
/
3600
)
if
(
hours
>
1
)
{
console
.
log
(
`Осталось
${
hours
}
часов`
)
}
else
if
(
hours
===
1
)
{
console
.
log
(
`Остался
${
hours
}
час`
)
}
else
{
console
.
log
(
`Осталось менее часа`
)
}
const
hours
=
Math
.
floor
(
userAnswer
/
3600
)
if
(
hours
>
1
)
{
console
.
log
(
`Осталось
${
hours
}
часов`
)
}
else
if
(
hours
===
1
)
{
console
.
log
(
`Остался
${
hours
}
час`
)
}
else
{
console
.
log
(
`Осталось менее часа`
)
console
.
log
(
'Нужно ввести числовые значение.'
)
}
</script>
</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