Created
          March 19, 2012 16:32 
        
      - 
      
- 
        Save clippit/2118324 to your computer and use it in GitHub Desktop. 
    Play a 24 Game with four 0s
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <stdio.h> | |
| int main() { | |
| printf("%d\n", '0'/(('0'+'0')/'0')); | |
| printf("%d\n", '0'>>'0'/'0'+0); | |
| printf("%d\n", -~-~-~-~-~-~0-~-~-~-~-~-~0-~-~-~-~-~-~0-~-~-~-~-~-~0); | |
| return 0; | |
| } | 
printf("%d\n", ((-0<<--~0);0)+--0)<<--0);-
printf("%d\n", ((!0<<!0)+!0)<<-
((0 – (~0)) << (0 – (~0))) << ((0 – (~0)) << (0 – (~0))) << (0 – (~0)) | ((0 – (~0)) << (0 – (~0))) << ((0 – (~0)) << (0 – (~0)))
(((0 - (~0)) << (0 - (~0))) | (0 - (~0))) << (((0 - (~0)) << (0 - (~0))) | (0 - (~0)))
'0' >> (0 - (~0))
Oops, only 4 zeros available...
O_0... I have just forgot that rule..
printf("%d\n",('0'-0)/(printf("%c",0) + printf("%c",0)));
3 zeros is enough~
2 zeros is enough~~
'0'>>!0
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
I love the third solution!
0's can be put after any '~' I like.