FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaRepository/Boris/src/laba2/SecondsToTime.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
/
Boris
/
src
/
laba2
/
SecondsToTime.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
20 lines (17 loc) · 767 Bytes
Breadcrumbs
JavaRepository
/
Boris
/
src
/
laba2
/
SecondsToTime.java
Copy path
File metadata and controls
20 lines (17 loc) · 767 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
package
laba2
;
//Task 2. Continue example, add calculating days and weeks. To take out result.
public
class
SecondsToTime
{
public
static
void
main
(
String
[]
args
) {
int
allSeconds
=
7
*
24
*
60
*
60
;
int
seconds
=
allSeconds
%
60
;
int
allMinutes
= (
allSeconds
-
seconds
) /
60
;
int
minutes
=
allMinutes
%
60
;
int
allHours
= (
allMinutes
-
minutes
) /
60
;
int
hours
=
allHours
%
24
;
int
allDay
= (
allHours
-
hours
) /
24
;
int
dow
=
allDay
%
7
;
int
allWeek
= (
allDay
-
dow
) /
7
;
System
.
out
.
printf
(
"%d секунд - это %d недель %d день недели %d часов %d минут %d секунд"
,
allSeconds
,
allWeek
,
dow
,
hours
,
minutes
,
seconds
);
}
}
Back
|
FazBrowse Home
|
New Git URL