FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaRepository/ivanchuk/src/task2/TaskTwo.java at master · karzhouAndrew/JavaRepository · GitHub
karzhouAndrew
/
JavaRepository
Public
Notifications
You must be signed in to change notification settings
Fork
16
Star
0
Code
Issues
0
Pull requests
96
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaRepository
/
ivanchuk
/
src
/
task2
/
TaskTwo.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (21 loc) · 947 Bytes
Breadcrumbs
JavaRepository
/
ivanchuk
/
src
/
task2
/
TaskTwo.java
Copy path
File metadata and controls
23 lines (21 loc) · 947 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package
task2
;
import
java
.
util
.
Scanner
;
//Имеется промежуток времени в секундах.
//Следует вывести его на страницу в виде недель, суток, часов, минут и секунд.
public
class
TaskTwo
{
public
static
void
main
(
String
[]
args
) {
Scanner
in
=
new
Scanner
(
System
.
in
);
System
.
out
.
println
(
"Введите целое число."
);
int
number
=
in
.
nextInt
();
in
.
close
();
int
seconds
=
number
%
60
;
int
min
= (
number
-
seconds
) /
60
;
int
minutes
=
min
%
60
;
int
hour
= (
min
-
minutes
) /
60
;
int
hours
=
hour
%
24
;
int
day
= (
hour
-
hours
) /
24
;
int
days
=
day
%
7
;
int
weeks
= (
day
-
days
) /
7
;
System
.
out
.
println
(
weeks
+
" недель "
+
days
+
" суток "
+
hours
+
" часов "
+
minutes
+
" минут "
+
seconds
+
" секунд."
);
}
}
Back
|
FazBrowse Home
|
New Git URL