fork(3) download
  1. #include <stdio.h>
  2.  
  3. int div3(int x){
  4. int y = (x>>2) + (x>>4);
  5. y+=y>>4;
  6. x=(x-y-(y<<1));
  7. y+=((x<<3)+(x<<1)+x)>>5;
  8. return y;
  9. }
  10.  
  11. int main(void) {
  12. for(int i=0;i<=255;i++){
  13. int y = div3(i);
  14. if(y!=i/3){
  15. printf("%d vs %d at %d\n", y, i/3, i);
  16. }
  17. }
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5520KB
stdin
Standard input is empty
stdout
Standard output is empty