Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kevin Lyda
cube-root-training
Commits
e07cf2b0
Commit
e07cf2b0
authored
Oct 13, 2017
by
Kevin Lyda
💬
Browse files
Based on caution / feedback from SA.
parent
9946b1f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
cube-test.c
View file @
e07cf2b0
...
...
@@ -27,6 +27,7 @@ read_number() {
if
(
!
fgets
(
buf
,
sizeof
buf
,
stdin
))
{
return
0
;
}
buf
[
9
]
=
0
;
return
atoi
(
buf
);
}
...
...
@@ -80,9 +81,11 @@ main(int argc, char *argv[]) {
guess
=
read_number
();
delta
=
end_timer
(
&
timer
);
if
(
guess
==
0
)
{
printf
(
"Got %d correct out of %d.
\n
"
,
correct
,
iterations
);
printf
(
"Average time to answer was %s
\n
"
,
humanize_usec
(
delta_total
/
iterations
));
if
(
iterations
)
{
printf
(
"Got %d correct out of %d.
\n
"
,
correct
,
iterations
);
printf
(
"Average time to answer was %s
\n
"
,
humanize_usec
(
delta_total
/
iterations
));
}
exit
(
0
);
}
iterations
++
;
...
...
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