Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- unsigned int prob(double k)
- {
- unsigned int i;
- unsigned int o;
- o = 1;
- for (i = 1;; i++)
- {
- o *= 2;
- if ((o * 2) > k) break;
- }
- return (o);
- }
- int main(void)
- {
- double l;
- unsigned int h;
- scanf("%lf", &l);
- h = prob(l);
- printf("%d\n", h);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement