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