Advertisement
Grugaloragran

Untitled

Sep 30th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. unsigned int prob(double k)
  3. {
  4.     unsigned int i;
  5.     unsigned int o;
  6. o = 1;
  7. for (i = 1;; i++)
  8. {
  9.     o *= 2;
  10.     if ((o * 2) > k) break;
  11.  
  12. }
  13.  
  14. return (o);
  15. }
  16. int main(void)
  17. {
  18.     double l;
  19.     unsigned int h;
  20.     scanf("%lf", &l);
  21.         h = prob(l);
  22.         printf("%d\n", h);
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement