Cooler_

mod op

Oct 1st, 2013
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. // my mod with bitwise
  2. #include <stdio.h>
  3.  
  4. int
  5. mod6(int x)
  6. {
  7.  while (x > 6)
  8.   x = (x&6) + (x>>3);
  9.  
  10.  return (!(x^6))?0:x;
  11. }
  12.  
  13.  
  14. int
  15. main()
  16. {
  17.  int a=256,n=6;
  18.  
  19.  printf("%d %d %d %d\n",  a-(n*(a/n)),a%n, ~(a-(5+((a>>(n>>1))<<(n>>1)))), mod6(a) );
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment