The following six pieces of the program mainly accomplish these things:
Output Hello, world
Chaos C Language Source code
All of the following programs can be compiled under GCC, only the last compiler to use C + + g++ to program through.
hello1.c
#define _________}
#define ________ Putchar
#define ___ Main
#define _ (a) ________ (a);
#define _____ ___ () {#define _ _ _ (
0x48) _ (0x65) _ (0x6c) _ (0x6c)
#define ___ _ (0x6f) _ (0x2c) _ (0x20) _ ( 0x77) _ (0x6f)
#define ____ _ (0x72) _ (0x6c) _ (0x64) _ (0x21)
#define _____ __ ___ ____ _________
#include < Stdio.h>
_____
Hello2.c
#include <stdio.h>
Main () {
int x=0,y[14],*z=&y;* (z++) =0x48;* (z++) =y[x++]+0x1d;
* (z++) =y[x++]+0x07;* (z++) =y[x++]+0x00;* (z++) =y[x++]+0x03;
* (z++) =y[x++]-0x43;* (z++) =y[x++]-0x0c;* (z++) =y[x++]+0x57;
* (z++) =y[x++]-0x08;* (z++) =y[x++]+0x03;* (z++) =y[x++]-0x06;
* (z++) =y[x++]-0x08;* (z++) =y[x++]-0x43;* (z++) =y[x]-0x21;
x=* (--z); while (Y[x]!=null) Putchar (y[x++));
Hello3.c
#include <stdio.h>
#define __ (a) goto A;
#define ___ (a) Putchar (a);
#define _ (A,B) ___ (a) __ (b);
Main ()
{_:__ (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)}
Hello4.c
int n[]={0x48,
0x65,0x6c,0x6c,
0x6f,0x2c,0x20,
0x77,0x6f,0x72,
0x6c,0x64,0x21,
0x0a,0x00},* M=n;
Main (n) {Putchar
(*m)!= '? Main (
m++): Exit (n++);}
Hello5.c
Main () {int i,n[]={((1<<1) << (1<<1) << (1<< 1) << (1<< (1>>1))) + (1 <<1) << (1<<1)) ((1 <<1) << (1<<1) << (1<<1) << (1<<1))-( (1<<1) << (1<<1) << (1<<1)) + ((1<<1) << (1<< (1>>1))) + (1 << (1>>1)) ((1<<1) << (1<<1) << (1<<1) << (1 <<1))-((1<<1) < < (1<<1) << (1<< (1>>1))-((1 <<1) << (1<< (1>>1))), ((1<<1) << (1<<1) << (1 <<1) << (1<<1))-((1<<1) << (1<<1) << (1< < (1>>1))-((1<<1) << (1<< (1>>1))), ((1<<1) << (1 <<1) << (1 <<1) << (1<<1))-((1<<1) << (1<<1) << (1<< (1>>1)))-(1<< (1 >>1)), ((1<<1) << (1<<1) << (1<<1) + ((1<<1) ≪< (1<<1) << (1<< (1>>1))-((1<<1) << (1<< (1>>1))), (1<<1 ) << (1<<1) << (1<<1) ((1<<1) << (1<<1) << (1<<1) << (1 << 1)-((1<<1) << (1<<1))-(1<< (1>>1)), ((1<< 1) << (1<<1) < < (1<<1) << (1<<1))-((1<<1) << (1 <<1) << (1<< (1>>1))-(1< < (1>>1)) ((1<<1) << (1<<1) << (1<<1) << (1<<1))-((1<<1) << (1 <<1) << (1<< (1>>1)) (1<<1)) ((1<<1) << (1<<1) << ( 1<<1) << (1<<1))-((1<<1) << (1<<1) << (1<< (1>>1)))-((1<< 1) << (1<< (1>>1)) ((1<<1) << (1<<1) << (1<<1) << (1<<1) )-((1 <<1) << (1<<1) << (1<<1)) + ((1<<1) << (1<< (1>> 1))), ((1<<1) << (1<<1) << (1<<1)) + (1<< (1 >>1)), (( 1<<1) << (1<<1)) + ((1<<1) << (1<< (1>>1))) + (1<< (1>>1)))}; For (i= (1>>1) < ((1<<1) << (1<<1)) + ((1 <<1) << (1<< (1>>1))) + (1&L t;<1)); i++) printf ("%c", N[i]);
}
Hello6.cpp
The following program can only be compiled by the C + + compiler (for example, g++)
#include <stdio.h> #define _ (_) Putchar (_);
int main (void) {int i = 0;_ (++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++i) _ (++++++++++++++++++++ +++++++++++++++++++++++++++ + ++++++++++i) _ (++++++++++++++ i) _ (--++i) _ (++++++i) _ (----------------------------------------------------------- ---------------------------------------------------------------------------i) _ (------------------------i) _ (+++ +++++
++++++++++++++++++++++++++++
++++++++++++++++++++++++++++
++++++++++++++++++++++++++++
+++++++++++++++++++++ +++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++i) _ (----------------i) _ (++++++ i) _ (------------i) _ (----------------i) _ (----------------------------------------------------------------------------------------- ---------------------------------------------i) _ (----------------------------------------------i) return i;}
(end of full text)