Displaying minutes in HH:MM formatCodeChef - Please like meHackerEarth Challenge Find Maximum Taste of Fruits“Angry Professor” Python implementationSeven-segment display GUINo more filthy wordsA class to store the number of seconds since midnightAlternating CharactersHackerEarth problem : number of occurrences of a number in the arrayGetting the Sum of Discounted Price
Solve this icositetragram
Using GNU screen, I get raw prompt with backslashes
Why is k-means used for non normally distributed data?
Divide Numbers by 0
Are there any writings by blinded and/or exiled Byzantine emperors?
One hour 10 min layover in Newark; International -> Domestic connection. Enough time to clear customs?
Can my UK debt be collected because I have to return to US?
How could reincarnation magic be limited to prevent overuse?
Why does dough containing a small amount of terumah become exempt from challah?
Why did the VIC-II and SID use 6 µm technology in the era of 3 µm and 1.5 µm?
How does Harry wear the invisibility cloak?
Does the size of capers influence their taste?
Is mathematics truth?
Visiting girlfriend in the USA
Map a function that takes arguments in different levels of a list
Would there be balance issues if I allowed opportunity attacks against any creature, not just hostile ones?
FHE: What is the difference between multiplicative depth and multiplicative level?
Is it rude to ask my opponent to resign an online game when they have a lost endgame?
Meaning of "offen balkon machen"?
How to disambiguate between various meditation practices?
Does secure hashing imply secure symmetric encryption?
Displaying minutes in HH:MM format
Playing boules... IN SPACE!
Why are Latin and Sanskrit called dead languages?
Displaying minutes in HH:MM format
CodeChef - Please like meHackerEarth Challenge Find Maximum Taste of Fruits“Angry Professor” Python implementationSeven-segment display GUINo more filthy wordsA class to store the number of seconds since midnightAlternating CharactersHackerEarth problem : number of occurrences of a number in the arrayGetting the Sum of Discounted Price
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
This program is a clock that only displays minutes passed since midnight. This program is supposed to be really simple but because of some "aesthetic bug", I wrote quite a lot if-else statements that I think can be simplified.
Format Input
The first line will contain an integer
T
, the number of test cases.
Each test case will contain an numberN
, the number displayed by the
strange clock.
Format Output
For each test case, print “Case X: “ (X starts with 1) and then print
what time it is in 24 hours HH:MM format.
Constraints
1 <=
T
<= 1000
0 <=
N
<= 1439
#include <stdio.h>
int main()
int T;
scanf("%d", &T);
for (int i = 1; i <= T; i++)
int N;
scanf("%d", &N);
int hours = N / 60;
int minutes = N % 60;
printf("Case #%d: ", i);
if (N < 10)
printf("00:0%dn", N);
else if (N > 10 && N < 60)
printf("00:%dn", N);
else if (N > 60 && N < 600)
if (minutes == 0)
printf("0%d:00n", hours);
else if (minutes > 0 && minutes < 10)
printf("0%d:0%dn", hours, minutes);
else
printf("0%d:%dn", hours, minutes);
else
if (minutes == 0)
printf("%d:00n", hours);
else if (minutes > 0 && minutes < 10)
printf("%d:0%dn", hours, minutes);
else
printf("%d:%dn", hours, minutes);
beginner algorithm c datetime formatting
New contributor
$endgroup$
add a comment |
$begingroup$
This program is a clock that only displays minutes passed since midnight. This program is supposed to be really simple but because of some "aesthetic bug", I wrote quite a lot if-else statements that I think can be simplified.
Format Input
The first line will contain an integer
T
, the number of test cases.
Each test case will contain an numberN
, the number displayed by the
strange clock.
Format Output
For each test case, print “Case X: “ (X starts with 1) and then print
what time it is in 24 hours HH:MM format.
Constraints
1 <=
T
<= 1000
0 <=
N
<= 1439
#include <stdio.h>
int main()
int T;
scanf("%d", &T);
for (int i = 1; i <= T; i++)
int N;
scanf("%d", &N);
int hours = N / 60;
int minutes = N % 60;
printf("Case #%d: ", i);
if (N < 10)
printf("00:0%dn", N);
else if (N > 10 && N < 60)
printf("00:%dn", N);
else if (N > 60 && N < 600)
if (minutes == 0)
printf("0%d:00n", hours);
else if (minutes > 0 && minutes < 10)
printf("0%d:0%dn", hours, minutes);
else
printf("0%d:%dn", hours, minutes);
else
if (minutes == 0)
printf("%d:00n", hours);
else if (minutes > 0 && minutes < 10)
printf("%d:0%dn", hours, minutes);
else
printf("%d:%dn", hours, minutes);
beginner algorithm c datetime formatting
New contributor
$endgroup$
$begingroup$
As I understand it, N is the number the clock must display, I.e. when N=1439, the clock should display 14:39. You should divide by 100 and not 60.
$endgroup$
– Édouard
13 hours ago
$begingroup$
@Édouard since a day has 1440 minutes, it's more likely that N is the number of minutes since midnight. This crucial information is missing from the instructions, which probably prepares the students to real-life situations, which are very similar.
$endgroup$
– Roland Illig
3 hours ago
$begingroup$
Or, the instructions may have included the definition of the "strange clock", and Elvan just didn't post this part.
$endgroup$
– Roland Illig
3 hours ago
add a comment |
$begingroup$
This program is a clock that only displays minutes passed since midnight. This program is supposed to be really simple but because of some "aesthetic bug", I wrote quite a lot if-else statements that I think can be simplified.
Format Input
The first line will contain an integer
T
, the number of test cases.
Each test case will contain an numberN
, the number displayed by the
strange clock.
Format Output
For each test case, print “Case X: “ (X starts with 1) and then print
what time it is in 24 hours HH:MM format.
Constraints
1 <=
T
<= 1000
0 <=
N
<= 1439
#include <stdio.h>
int main()
int T;
scanf("%d", &T);
for (int i = 1; i <= T; i++)
int N;
scanf("%d", &N);
int hours = N / 60;
int minutes = N % 60;
printf("Case #%d: ", i);
if (N < 10)
printf("00:0%dn", N);
else if (N > 10 && N < 60)
printf("00:%dn", N);
else if (N > 60 && N < 600)
if (minutes == 0)
printf("0%d:00n", hours);
else if (minutes > 0 && minutes < 10)
printf("0%d:0%dn", hours, minutes);
else
printf("0%d:%dn", hours, minutes);
else
if (minutes == 0)
printf("%d:00n", hours);
else if (minutes > 0 && minutes < 10)
printf("%d:0%dn", hours, minutes);
else
printf("%d:%dn", hours, minutes);
beginner algorithm c datetime formatting
New contributor
$endgroup$
This program is a clock that only displays minutes passed since midnight. This program is supposed to be really simple but because of some "aesthetic bug", I wrote quite a lot if-else statements that I think can be simplified.
Format Input
The first line will contain an integer
T
, the number of test cases.
Each test case will contain an numberN
, the number displayed by the
strange clock.
Format Output
For each test case, print “Case X: “ (X starts with 1) and then print
what time it is in 24 hours HH:MM format.
Constraints
1 <=
T
<= 1000
0 <=
N
<= 1439
#include <stdio.h>
int main()
int T;
scanf("%d", &T);
for (int i = 1; i <= T; i++)
int N;
scanf("%d", &N);
int hours = N / 60;
int minutes = N % 60;
printf("Case #%d: ", i);
if (N < 10)
printf("00:0%dn", N);
else if (N > 10 && N < 60)
printf("00:%dn", N);
else if (N > 60 && N < 600)
if (minutes == 0)
printf("0%d:00n", hours);
else if (minutes > 0 && minutes < 10)
printf("0%d:0%dn", hours, minutes);
else
printf("0%d:%dn", hours, minutes);
else
if (minutes == 0)
printf("%d:00n", hours);
else if (minutes > 0 && minutes < 10)
printf("%d:0%dn", hours, minutes);
else
printf("%d:%dn", hours, minutes);
beginner algorithm c datetime formatting
beginner algorithm c datetime formatting
New contributor
New contributor
edited 2 hours ago
dfhwze
10.6k2 gold badges19 silver badges69 bronze badges
10.6k2 gold badges19 silver badges69 bronze badges
New contributor
asked yesterday
Elvan SelvanoElvan Selvano
587 bronze badges
587 bronze badges
New contributor
New contributor
$begingroup$
As I understand it, N is the number the clock must display, I.e. when N=1439, the clock should display 14:39. You should divide by 100 and not 60.
$endgroup$
– Édouard
13 hours ago
$begingroup$
@Édouard since a day has 1440 minutes, it's more likely that N is the number of minutes since midnight. This crucial information is missing from the instructions, which probably prepares the students to real-life situations, which are very similar.
$endgroup$
– Roland Illig
3 hours ago
$begingroup$
Or, the instructions may have included the definition of the "strange clock", and Elvan just didn't post this part.
$endgroup$
– Roland Illig
3 hours ago
add a comment |
$begingroup$
As I understand it, N is the number the clock must display, I.e. when N=1439, the clock should display 14:39. You should divide by 100 and not 60.
$endgroup$
– Édouard
13 hours ago
$begingroup$
@Édouard since a day has 1440 minutes, it's more likely that N is the number of minutes since midnight. This crucial information is missing from the instructions, which probably prepares the students to real-life situations, which are very similar.
$endgroup$
– Roland Illig
3 hours ago
$begingroup$
Or, the instructions may have included the definition of the "strange clock", and Elvan just didn't post this part.
$endgroup$
– Roland Illig
3 hours ago
$begingroup$
As I understand it, N is the number the clock must display, I.e. when N=1439, the clock should display 14:39. You should divide by 100 and not 60.
$endgroup$
– Édouard
13 hours ago
$begingroup$
As I understand it, N is the number the clock must display, I.e. when N=1439, the clock should display 14:39. You should divide by 100 and not 60.
$endgroup$
– Édouard
13 hours ago
$begingroup$
@Édouard since a day has 1440 minutes, it's more likely that N is the number of minutes since midnight. This crucial information is missing from the instructions, which probably prepares the students to real-life situations, which are very similar.
$endgroup$
– Roland Illig
3 hours ago
$begingroup$
@Édouard since a day has 1440 minutes, it's more likely that N is the number of minutes since midnight. This crucial information is missing from the instructions, which probably prepares the students to real-life situations, which are very similar.
$endgroup$
– Roland Illig
3 hours ago
$begingroup$
Or, the instructions may have included the definition of the "strange clock", and Elvan just didn't post this part.
$endgroup$
– Roland Illig
3 hours ago
$begingroup$
Or, the instructions may have included the definition of the "strange clock", and Elvan just didn't post this part.
$endgroup$
– Roland Illig
3 hours ago
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Following @Martin R's comment, I'll make my comment above a solution:
printf
already supports what you're trying to achieve with your if-then-else jungle:
#include <stdio.h>
int main()
int T;
scanf("%d", &T);
for (int i = 1; i <= T; i++)
int N;
scanf("%d", &N);
int hours = N / 60;
int minutes = N % 60;
printf("Case #%d: %02d:%02dn", i, hours, minutes);
You're also missing to check the return value of scanf
. It is used to report errors in the input. What is the purpose of the first scanf
?
Also, I'd change the variable naming. Use minutes
instead of N
to communicate clearly what you're handling in the variable. You can then write the computation directly in the parameter list of printf, saving you two additional variables.
$endgroup$
5
$begingroup$
"saving you two additional variables" - in this case, I think the separated variables are actually a good idea. They shouldn't incur a performance drop, and they help to self-document the code.
$endgroup$
– Reinderien
yesterday
$begingroup$
Thank you, added it.
$endgroup$
– Cornholio
yesterday
$begingroup$
"Useminutes
instead of N to communicate clearly what you're handling in the variable." The symbol N is explicitly defined in the problem statement. However, the wordminutes
could mean either N or the "minutes" field in the output.
$endgroup$
– JiK
9 hours ago
$begingroup$
Note that with input like-61
, Output of-01:00
might be preferred over this answer's"-01:-01"
. Yet with "0 <= N <= 1439" and "minutes passed since midnight", we might not worry about yesterday.
$endgroup$
– chux
49 mins ago
add a comment |
$begingroup$
If your code is checked by an automated process, you will probably fail all test cases because your code prints a #
, which was not asked for. You should better remove it. Just print "Case %d" instead of "Case #%d".
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "196"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Elvan Selvano is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f227255%2fdisplaying-minutes-in-hhmm-format%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Following @Martin R's comment, I'll make my comment above a solution:
printf
already supports what you're trying to achieve with your if-then-else jungle:
#include <stdio.h>
int main()
int T;
scanf("%d", &T);
for (int i = 1; i <= T; i++)
int N;
scanf("%d", &N);
int hours = N / 60;
int minutes = N % 60;
printf("Case #%d: %02d:%02dn", i, hours, minutes);
You're also missing to check the return value of scanf
. It is used to report errors in the input. What is the purpose of the first scanf
?
Also, I'd change the variable naming. Use minutes
instead of N
to communicate clearly what you're handling in the variable. You can then write the computation directly in the parameter list of printf, saving you two additional variables.
$endgroup$
5
$begingroup$
"saving you two additional variables" - in this case, I think the separated variables are actually a good idea. They shouldn't incur a performance drop, and they help to self-document the code.
$endgroup$
– Reinderien
yesterday
$begingroup$
Thank you, added it.
$endgroup$
– Cornholio
yesterday
$begingroup$
"Useminutes
instead of N to communicate clearly what you're handling in the variable." The symbol N is explicitly defined in the problem statement. However, the wordminutes
could mean either N or the "minutes" field in the output.
$endgroup$
– JiK
9 hours ago
$begingroup$
Note that with input like-61
, Output of-01:00
might be preferred over this answer's"-01:-01"
. Yet with "0 <= N <= 1439" and "minutes passed since midnight", we might not worry about yesterday.
$endgroup$
– chux
49 mins ago
add a comment |
$begingroup$
Following @Martin R's comment, I'll make my comment above a solution:
printf
already supports what you're trying to achieve with your if-then-else jungle:
#include <stdio.h>
int main()
int T;
scanf("%d", &T);
for (int i = 1; i <= T; i++)
int N;
scanf("%d", &N);
int hours = N / 60;
int minutes = N % 60;
printf("Case #%d: %02d:%02dn", i, hours, minutes);
You're also missing to check the return value of scanf
. It is used to report errors in the input. What is the purpose of the first scanf
?
Also, I'd change the variable naming. Use minutes
instead of N
to communicate clearly what you're handling in the variable. You can then write the computation directly in the parameter list of printf, saving you two additional variables.
$endgroup$
5
$begingroup$
"saving you two additional variables" - in this case, I think the separated variables are actually a good idea. They shouldn't incur a performance drop, and they help to self-document the code.
$endgroup$
– Reinderien
yesterday
$begingroup$
Thank you, added it.
$endgroup$
– Cornholio
yesterday
$begingroup$
"Useminutes
instead of N to communicate clearly what you're handling in the variable." The symbol N is explicitly defined in the problem statement. However, the wordminutes
could mean either N or the "minutes" field in the output.
$endgroup$
– JiK
9 hours ago
$begingroup$
Note that with input like-61
, Output of-01:00
might be preferred over this answer's"-01:-01"
. Yet with "0 <= N <= 1439" and "minutes passed since midnight", we might not worry about yesterday.
$endgroup$
– chux
49 mins ago
add a comment |
$begingroup$
Following @Martin R's comment, I'll make my comment above a solution:
printf
already supports what you're trying to achieve with your if-then-else jungle:
#include <stdio.h>
int main()
int T;
scanf("%d", &T);
for (int i = 1; i <= T; i++)
int N;
scanf("%d", &N);
int hours = N / 60;
int minutes = N % 60;
printf("Case #%d: %02d:%02dn", i, hours, minutes);
You're also missing to check the return value of scanf
. It is used to report errors in the input. What is the purpose of the first scanf
?
Also, I'd change the variable naming. Use minutes
instead of N
to communicate clearly what you're handling in the variable. You can then write the computation directly in the parameter list of printf, saving you two additional variables.
$endgroup$
Following @Martin R's comment, I'll make my comment above a solution:
printf
already supports what you're trying to achieve with your if-then-else jungle:
#include <stdio.h>
int main()
int T;
scanf("%d", &T);
for (int i = 1; i <= T; i++)
int N;
scanf("%d", &N);
int hours = N / 60;
int minutes = N % 60;
printf("Case #%d: %02d:%02dn", i, hours, minutes);
You're also missing to check the return value of scanf
. It is used to report errors in the input. What is the purpose of the first scanf
?
Also, I'd change the variable naming. Use minutes
instead of N
to communicate clearly what you're handling in the variable. You can then write the computation directly in the parameter list of printf, saving you two additional variables.
edited yesterday
answered yesterday
CornholioCornholio
7762 silver badges10 bronze badges
7762 silver badges10 bronze badges
5
$begingroup$
"saving you two additional variables" - in this case, I think the separated variables are actually a good idea. They shouldn't incur a performance drop, and they help to self-document the code.
$endgroup$
– Reinderien
yesterday
$begingroup$
Thank you, added it.
$endgroup$
– Cornholio
yesterday
$begingroup$
"Useminutes
instead of N to communicate clearly what you're handling in the variable." The symbol N is explicitly defined in the problem statement. However, the wordminutes
could mean either N or the "minutes" field in the output.
$endgroup$
– JiK
9 hours ago
$begingroup$
Note that with input like-61
, Output of-01:00
might be preferred over this answer's"-01:-01"
. Yet with "0 <= N <= 1439" and "minutes passed since midnight", we might not worry about yesterday.
$endgroup$
– chux
49 mins ago
add a comment |
5
$begingroup$
"saving you two additional variables" - in this case, I think the separated variables are actually a good idea. They shouldn't incur a performance drop, and they help to self-document the code.
$endgroup$
– Reinderien
yesterday
$begingroup$
Thank you, added it.
$endgroup$
– Cornholio
yesterday
$begingroup$
"Useminutes
instead of N to communicate clearly what you're handling in the variable." The symbol N is explicitly defined in the problem statement. However, the wordminutes
could mean either N or the "minutes" field in the output.
$endgroup$
– JiK
9 hours ago
$begingroup$
Note that with input like-61
, Output of-01:00
might be preferred over this answer's"-01:-01"
. Yet with "0 <= N <= 1439" and "minutes passed since midnight", we might not worry about yesterday.
$endgroup$
– chux
49 mins ago
5
5
$begingroup$
"saving you two additional variables" - in this case, I think the separated variables are actually a good idea. They shouldn't incur a performance drop, and they help to self-document the code.
$endgroup$
– Reinderien
yesterday
$begingroup$
"saving you two additional variables" - in this case, I think the separated variables are actually a good idea. They shouldn't incur a performance drop, and they help to self-document the code.
$endgroup$
– Reinderien
yesterday
$begingroup$
Thank you, added it.
$endgroup$
– Cornholio
yesterday
$begingroup$
Thank you, added it.
$endgroup$
– Cornholio
yesterday
$begingroup$
"Use
minutes
instead of N to communicate clearly what you're handling in the variable." The symbol N is explicitly defined in the problem statement. However, the word minutes
could mean either N or the "minutes" field in the output.$endgroup$
– JiK
9 hours ago
$begingroup$
"Use
minutes
instead of N to communicate clearly what you're handling in the variable." The symbol N is explicitly defined in the problem statement. However, the word minutes
could mean either N or the "minutes" field in the output.$endgroup$
– JiK
9 hours ago
$begingroup$
Note that with input like
-61
, Output of -01:00
might be preferred over this answer's "-01:-01"
. Yet with "0 <= N <= 1439" and "minutes passed since midnight", we might not worry about yesterday.$endgroup$
– chux
49 mins ago
$begingroup$
Note that with input like
-61
, Output of -01:00
might be preferred over this answer's "-01:-01"
. Yet with "0 <= N <= 1439" and "minutes passed since midnight", we might not worry about yesterday.$endgroup$
– chux
49 mins ago
add a comment |
$begingroup$
If your code is checked by an automated process, you will probably fail all test cases because your code prints a #
, which was not asked for. You should better remove it. Just print "Case %d" instead of "Case #%d".
$endgroup$
add a comment |
$begingroup$
If your code is checked by an automated process, you will probably fail all test cases because your code prints a #
, which was not asked for. You should better remove it. Just print "Case %d" instead of "Case #%d".
$endgroup$
add a comment |
$begingroup$
If your code is checked by an automated process, you will probably fail all test cases because your code prints a #
, which was not asked for. You should better remove it. Just print "Case %d" instead of "Case #%d".
$endgroup$
If your code is checked by an automated process, you will probably fail all test cases because your code prints a #
, which was not asked for. You should better remove it. Just print "Case %d" instead of "Case #%d".
answered yesterday
Roland IlligRoland Illig
15.1k2 gold badges24 silver badges58 bronze badges
15.1k2 gold badges24 silver badges58 bronze badges
add a comment |
add a comment |
Elvan Selvano is a new contributor. Be nice, and check out our Code of Conduct.
Elvan Selvano is a new contributor. Be nice, and check out our Code of Conduct.
Elvan Selvano is a new contributor. Be nice, and check out our Code of Conduct.
Elvan Selvano is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Code Review Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f227255%2fdisplaying-minutes-in-hhmm-format%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
As I understand it, N is the number the clock must display, I.e. when N=1439, the clock should display 14:39. You should divide by 100 and not 60.
$endgroup$
– Édouard
13 hours ago
$begingroup$
@Édouard since a day has 1440 minutes, it's more likely that N is the number of minutes since midnight. This crucial information is missing from the instructions, which probably prepares the students to real-life situations, which are very similar.
$endgroup$
– Roland Illig
3 hours ago
$begingroup$
Or, the instructions may have included the definition of the "strange clock", and Elvan just didn't post this part.
$endgroup$
– Roland Illig
3 hours ago