This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 20th, 2011  |  syntax: None  |  size: 0.28 KB  |  views: 412  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data