1. /***********************************************************************  
  2. * ioccc "hello world"世界C语言乱码大赛作品(2010-05-04 17:34:08)  
  3. *  
  4. * This page combines two things I like: "Hello, World!" programs and obfuscated C programs.  
  5. *  
  6. * The following programs should all compile with GCC and the Borland command line compiler  
  7. *  
  8. * for Windows (bcc32).  
  9. ***********************************************************************/ 
  10.  
  11. //------------------------------------------------------------**  
  12.  
  13. //hello1.c ( VC6、GCC通过 )  
  14.  
  15. #define _________ }  
  16. #define ________ putchar  
  17. #define _______ main  
  18. #define _(a) ________(a);  
  19. #define ______ _______(){  
  20. #define __ ______ _(0x48)_(0x65)_(0x6C)_(0x6C)  
  21. #define ___ _(0x6F)_(0x2C)_(0x20)_(0x77)_(0x6F)  
  22. #define ____ _(0x72)_(0x6C)_(0x64)_(0x21)  
  23. #define _____ __ ___ ____ _________  
  24. #include<stdio.h>  
  25. _____  
  26.  
  27. //------------------------------------------------------------*///  
  28. /*  
  29.  
  30. //hello2.c  
  31.  
  32. #include<stdio.h>  
  33.  
  34. main(){  
  35.     int x=0,y[14],*z=&y;  
  36.     *(z++)=0x48;  
  37.     *(z++)=y[x++]+0x1D;  
  38.     *(z++)=y[x++]+0x07;  
  39.     *(z++)=y[x++]+0x00;  
  40.     *(z++)=y[x++]+0x03;  
  41.     *(z++)=y[x++]-0x43;  
  42.     *(z++)=y[x++]-0x0C;  
  43.     *(z++)=y[x++]+0x57;  
  44.     *(z++)=y[x++]-0x08;  
  45.     *(z++)=y[x++]+0x03;  
  46.     *(z++)=y[x++]-0x06;  
  47.     *(z++)=y[x++]-0x08;  
  48.     *(z++)=y[x++]-0x43;  
  49.     *(z++)=y[x]-0x21;  
  50.     x=*(--z);  
  51.     while(y[x]!=NULL) putchar(y[x++]);  
  52. }  
  53.  
  54. //------------------------------------------------------------*///  
  55. /*  
  56.  
  57. //hello3.c ( VC6、GCC通过 )  
  58.  
  59. #include<stdio.h>  
  60. #define __(a) goto a;  
  61. #define ___(a) putchar(a);  
  62. #define _(a,b) ___(a) __(b);  
  63. int main()  
  64. {  
  65.     _:__(t)a:_('r',g)b:_('$',p) c:_('l',f)d:_(' ',s)e:_('a',s) f:_('o',q)g:_('l',h)h:_('d',n) i:_('e',w)j:_('e',x)k:_('\n',z) l:_('H',l)m:_('X',i)n:_('!',k) o:_('z',q)p:_('q',b)q:_(',',d) r:_('i',l)s:_('w',v)t:_('H',j) u:_('a',a)v:_('o',a)w:_(')',k) x:_('l',c)y:_('\t',g)z:___(0x0)  
  66.     return 0;  
  67. }  
  68.  
  69. //------------------------------------------------------------*///  
  70. /*  
  71.  
  72. //hello4.c  
  73.  
  74. #include <stdio.h>  
  75. int n[]={0x48, 0x65,0x6C,0x6C, 0x6F,0x2C,0x20, 0x77,0x6F,0x72, 0x6C,0x64,0x21, 0x0A,0x00}, *m=n;  
  76. main(n)  
  77. {  
  78.     putchar(*m)!='\0' ? main (m++) : exit(n++);  
  79. }  
  80.  
  81. //------------------------------------------------------------*///  
  82. /*  
  83.  
  84. //hello5.c ( VC6、GCC通过 )  
  85.  
  86. #include <stdio.h>  
  87. int main(){  
  88.     int i,n[]={  
  89.         (((1<<1)<<(1<<1)<<(1<< 1)<<(1<<(1>>1)))+((1<<1)<<(1<<1))),  
  90.         (((1 <<1)<<(1<<1)<<(1<<1)<<(1<<1))-((1<<1)<<( 1<<1)<<(1<<1))+((1<<1)<<(1<<(1>>1)))+(1 <<(1>>1))),  
  91.         (((1<<1)<<(1<<1)<<(1<<1)<< (1 <<1))-((1<<1)<<(1<<1)<<(1<<(1>>1)))-((1 <<1)<<(1<<(1>>1)))),  
  92.         (((1<<1)<<(1<<1)<<(1 <<1)<<(1<<1))-((1<<1)<<(1<<1)<<(1<<(1>>1 )))-((1<<1)<<(1<<(1>>1)))),  
  93.         (((1<<1)<< (1 <<1)<<(1<<1)<<(1<<1))-((1<<1)<<(1<<1)<<( 1<<(1>>1)))-(1<<(1>>1))),  
  94.         (((1<<1)<<(1<<1 )<<(1<<1))+((1<<1)<<(1<<1)<<(1<<(1>>1))) -((1<<1)<<(1<<(1>>1)))),  
  95.         ((1<<1)<< (1<<1) <<(1<<1)),(((1<<1)<<(1<<1)<<(1<<1)<<(1<< 1))-((1<<1)<<(1<<1))-(1<<(1>>1))),  
  96.         (((1<< 1)<<(1<<1)<<(1<<1)<<(1<<1))-((1<<1)<< (1 <<1)<<(1<<(1>>1)))-(1<<(1>>1))),  
  97.         (((1<<1 )<<(1<<1)<<(1<<1)<<(1<<1))- ((1<<1)<< (1 <<1)<<(1<<(1>>1)))+(1<<1)),  
  98.         (((1<<1)<< ( 1<<1)<<(1<<1)<< (1<<1))-((1<<1)<< (1<<1) <<(1<<(1>>1)))-((1<<1) <<(1<< (1>>1)))),  
  99.         (((1<<1)<< (1<<1)<<(1<<1)<< (1<<1))- ((1 <<1)<<(1<<1)<<(1<<1))+((1<<1)<< (1<<(1>> 1)))),  
  100.         (((1<<1)<<(1<<1) <<(1<<1))+(1<<(1 >>1))),(((1<<1)<<(1<<1))+((1<<1)<< (1<<( 1>>1))) + (1<< (1>>1)))  
  101.     };  
  102.  
  103.     for(i=(1>>1); i<(((1<<1) <<(1<<1))+((1 <<1)<< (1<<(1>>1 ))) + (1<<1));i++)  
  104.     {  
  105.         printf("%c", n[i]);  
  106.     }  
  107.     return 0;  
  108. }  
  109.  
  110. //------------------------------------------------------------*///  
  111. /*  
  112.  
  113. //hello6.cpp ( VC6、GCC通过 )  
  114.  
  115. //Cheating a bit here. This only works with a cpp compiler (tried it with g++).  
  116.  
  117. #include <stdio.h>  
  118. #define _(_) putchar(_);  
  119.  
  120. int main(){  
  121.     int i = 0;  
  122.     _( ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++i)_(++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++i)_(++++++++++++++ i)_(--++i)_(++++++i)_(------ ---------------------------- ---------------------------- ---------------------------- ---------------------------- ----------------i)_(-------- ----------------i)_(++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++i) _(----------------i)_(++++++ i)_(------------i)_(-------- --------i)_(---------------- ---------------------------- ---------------------------- ---------------------------- ---------------------------- ------i)_(------------------ ---------------------------- i)return i;  
  123. }  
  124.  
  125. //*/ 

牛,很难看懂(目前我只看懂了一个,有时间再慢慢琢磨,呵呵),这个对打牢基础很有帮助,嘿嘿...

(说明:经改动,以上几个程序可以放在同一个文件中,每次换一个程序只需将当前程序上面的单行注释末尾的多行注释开始标记换行,并将下面的单行注释后面的多行注释开始标记放到其末尾,“Enter”和“Backspace”两键搞定,很简单!)

仔细研究研究吧,对于这些乱码程序的理解对于锻炼代码阅读能力很有帮助,而且可以从中学到不少窍门,顺便转告一下大家的忠告:大师把代码写在这样叫艺术,你把代码写成这样叫垃圾!~