Advertisement
Guest User

Untitled

a guest
Sep 20th, 2011
639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. /*
  2. * fitsBits - return 1 if x can be represented as an
  3. * n-bit, two's complement integer.
  4. * 1 <= n <= 32
  5. * Examples: fitsBits(5,3) = 0, fitsBits(-4,3) = 1
  6. * Legal ops: ! ~ & ^ | + << >>
  7. * Max ops: 15
  8. * Rating: 2
  9. */
  10. int fitsBits(int x, int n) {
  11. return 2;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement