fork(1) download
  1. #define R return
  2. #define C ;break;case
  3. c[999]={};*P=c;*S[28];M[99999]={};t;*T;
  4. u(s,v){S[s]+=28;*S[s]=v;
  5. if(s>26){for(t=v/10;t;t/=10)S[s]+=28;T=S[s];do{*T=48+v%10;T-=28;}while(v/=10);}}
  6. o(s){t=S[s]-M>27;S[s]-=28*t;R S[s][28]*t;}
  7. I(s){R s<65?27:s-97;}
  8. O(int*p){if(!isdigit(*p))R o(I(*p));
  9. for(;isdigit(p[-1]);--p);for(t=0;isdigit(*p);t*=10,t+=*p++-48);R t;}
  10.  
  11. main(i,a){for(i=0;i<28;++i)S[i]=M+i;
  12. for(;~(*++P=getchar()););P=c+1;
  13. for(;;){i=I(P[-1]);switch(*P++){
  14. case 35:for(;*P++!=10;)
  15. C'<':u(i,O(P))
  16. C'>':u(I(*P),O(P-2))
  17. C'+':u(i,*S[i]+O(P))
  18. C'-':u(i,*S[i]-O(P))
  19. C'?':if(!*S[i])S[i]=M+i
  20. C'(':for(i=1,T=P;i;++T)i+=(*T==40)-(*T==41);if(S[I(*P)]-M<28)P=T;else u(26,P-c)
  21. C')':P=c+o(26)-1
  22. C-1:for(;i=o(14);)putchar(i); R 0;}}}
Success #stdin #stdout 0.32s 2552KB
stdin
#prime.k by Jannis Harder
u<200
#change 200


k<2>m
u-2
(u-1 u>t u>z u<t
  (k>e e+0 e>r)
  (e>k)
  m+1
  m>t
  m>z
  m<t
  t<0>z? t?
  1>g
  (r>b
    m+0 m>a
    b+0 b>w
    (a-1 
      b+0 b>j
      j?
      1>s
      (j<0>s j?)
      s?
      (s<0 w+0 w>b s?)
      a>t
      a>z
      t>a
      b-1
      b>t
      b>z
      t>b
      z<0>t? z?
    a?)
    b?
    1>p
    (b<0 b? 0>p)
    p?
    (p 0>r? 0>p? 0>g)
  )
  g?
  (g m+0 m>k 0>g?)
u?)
(k>@
  10>o
  (@>o)
)
stdout
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
73
79
83
89
97
101
103
107
109
113
127
131
137
139
149
151
157
163
167
173
179
181
191
193
197
199