Last updated 1 month ago
Time Complexity: O(1)O(1)O(1)
This a give-away question. The soul is to find the maths relation between the input and the answer. And this relation is shown in the code below.
#include <stdio.h> int main() { int percent; scanf("%d", &percent); double option1 = (double)(100 - percent) / (double)percent; double option2 = (double)percent / (double)(100 - percent); printf("%lf\n", (double)1 + option1); printf("%lf\n", (double)1 + option2); }