Cast NSUD to double when calculating solved percentage
This commit is contained in:
2
main.c
2
main.c
@@ -59,7 +59,7 @@ int main(void)
|
|||||||
++solved;
|
++solved;
|
||||||
}
|
}
|
||||||
|
|
||||||
double solved_pc = 1e2 * (double)solved / NSUD;
|
double solved_pc = 1e2 * (double)solved / (double)NSUD;
|
||||||
printf("Solved %u/%u (%.3lf%%)\n", solved, NSUD, solved_pc);
|
printf("Solved %u/%u (%.3lf%%)\n", solved, NSUD, solved_pc);
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|||||||
Reference in New Issue
Block a user