c语言代码混乱大赛
A. 国际c语言混乱代码大赛的代码样例
第21届国际C语言混乱代码大赛(IOCCC)正式发布了获奖源代码。IOCCC要求参赛者写出最有创意且最让人难以理解的C语言代码,大小限制在4 kb以内,因此每位参赛者的作品都让人印象深刻。获胜者包括1名法国人,1名韩国人,5名美国人,1名比利时人,1名以色列人,1名英国人,4名日本人和1名中国人。
选取了几个代表性作品大家共赏一下更可怕的是,它们都可以编译通过!!!! #include <stdio.h>
#include <stdlib.h>
#define s(_)sizeof(_)
#define n void*
#define z(_)_,_,_
#define x (s*)__
#define y (s*)_
#define h C(y,y)
#define o &d
#define t() (p)
#define w(_)_,_
typedef n (*(*(*(*p)(n,n))(n,n))(n,n))(n,n);
typedef struct s { struct s* a ; struct s* UNUSED; } s;
typedef struct t { struct s* UNUSED; struct s* a ; } *t;
n __(n _,n __) { return _;}n _(n _,n __){return __; }
typedef unsigned char e;
#define _(_)((*_).a)
s*
w,
a={x ,x},
b={x ,y},
c={y,x},d={y,y};s l[]={&b,&d,w (w(w(w(w(w(&d)))))),w(&d),&c,&d,w(w(w(
&d))),&c,w(&b),&d,&a,z(&d),z(w (w(w(w(w(&d)))))),&b,&b,w(&d),&a,&b,w(&
d), z(w
(w( w(w
(&d))))),w(w(w(&d))), &b,&c,&d, &d,&a,&c ,w(w(&d)), &c,z(&b) ,w(&d),w(&a)
};s* C(s* a, s* b) {s* _=malloc(s(s));_(_)=a;_((t)_)=b;return _;}e k2=s(l
);p f(p
a,p b)
{ e k;s d;p v,r, q,i,C,c,u,g,m=t( )
_ ( _(_(w)));C=t() _(_(&l[fread(&k,s(e )
,s ( e),stdin)]));v =C(_,__);d=l[k=(e )
C ( k2,k)];c=(u=a( b,_),i=(t()_((t )
_ ( _(w))))(_,_(_(o)) ),(a(_(_((t)o)),(t( )
_ ( _((t)o)))(_,__) ))(b(_((t)_((t)o) )
, ( t()_((t)_((t)o))) (_,__)),_));{p a=t( )
_ ( (t)_(o));{p b= C(_,i(u(_,__),_) )
; { p u=C(_,(t()_(_(o) ))(_,__));_(_(_(w)) )
= ( s*)i(__,_(_( _(w))));r=b(m(c,_ )
,C ( m(_,(t()_(( t)_(_(w))))(_,__) )
, ( f)));v=b(_,v);i =b(a(_,__),_);g=(b )
( a(m(c(_,__),__ ),_),_);q=u(_((t )
_ ( o)),_)((t()_( (t)_(_(w))))((t( )
_ ( _((t)o)))(_(_((t )_(w))),(t()_(_((t )
_ ( w))))(_,__))( _,__),_)(_,__),_ )
;_ ( _((t)_(w))) = (s*)u(_((t)_(o)),_ )
( (t()_((t)_(_(w)))) (_,__),_)(_(_((t)o) )
,_ ( _((t)_(w))));} }_((t)_(_(w)))=(s* )
q ( a=(t()_((t)_(_(w))) )(_,__),_((t)_(_(w))) )
; fwrite((k=k,&k2) ,s(e),u(_,g)(s(e )
, ( e)s(s[s(s[s(s[s (s)])])])),stdout )
; fwrite((k2=k,&k) ,s(e),u(__,g)(s(e )
, ( e)s(s[s(s[s(s[s (s)])])])),stdout )
;_ ( _(_((t)w)))=(s*) u((t()_(_(_((t)w))) )
( _,__),_(_(_((t)w ))));_(_((t)_(w)) )
= ( s*)q(a(_(_((t) o)),_(_((t)_(w))) )
,_ ( _((t)_(w))));} _((t)_(_((t)w)))=(s* )
( t()_(_(_((t)w))) )(_((t)_(_((t)w)) )
,u ( (t()_((t)_(_(( t)w))))(_,__),_((t )
_ ( _((t)w)))));g =u((q=u(C(__,(t( )
_ ( _(_((t)w))))(_((t )_(_((t)w))),_)),_) )
( _,__),g);v=g( __,i(u(_,i(f,_) )
( _(_((t)o)),_( (t)_((t)o))),v) )
,r= q(_
,g( f,i
(v(f,(_(_(_(w)))=(s*)m,_)),r)));return q(_,v)(r(g(__,a),g(__,b)),r);}
int main
(){w=C(C(h,h),C(h,h));return printf((e*)f(_,_)(OK
,
^ Error
)) (运行生成更小的头像代码) /*++++[>i>n[t*/#include<stdio.h>/*2w0,1m2,]_<n+am+o>r>i>=>(['0n1'0)1;*/int/**/main(int/**/n,char**m){FILE*p,*q;intA,k,a,r,i/*#uinndcelfu_dset<rsitcdti_oa.nhs>i/_*/;char*d=P%d
%d40%d/**/
%d
0wb+,b[1024],y[]=yuriyurarararayuruyuri*daijiken**akkari~n**/y*u*k/riin<ty(uyr)g,aur,arr[a1r2a82*y2*/u*r{uyu}riOcyurhiyua**rrar+*arayra*=yuruyurwiyuriyurara'rariayuruyuriyuriyu>rarararayuruy9uriyu3riyurar_aBrMaPrOaWy^?*]/f]`;hvroai<dp/f*i*s/<ii(f)a{tpguat<cahfaurh(+uf)a;f}vivn+tf/g*`*w/jmaa+i`ni(/***/i+k[>+b+i>++b++>l[rb;int/**/u;for(i=0;i<101;i++)y[i*2]^=~hktrvg~dmG*eoa+%squ#l2:(wn1l))v?wM353{/Y;lgcGp`vedllwudvOK`cct~[|ju{stkjalor(stwvnegtyogYURUYURI[i]^y[i*2+1]^4;/*!*/p=(n>1&&(m[1][0]-'-'||m[1][1]!='