fork download
  1. #include <iostream>
  2.  
  3. typedef unsigned I;template<I o,I O,void(*i)(I)>struct l{void
  4. operator()(){i(o);l<o+1,O,i>()();}};template<I i,void(*O)(I)>
  5. struct l<i,i,O>{void operator()(){}};template<I O> I o(){ret\
  6. urn o<O-1>()*10;}template<>I o<1>(){return 1;}template<I i>s\
  7. truct O{I operator()(I _){I l =_/o<i>()%10;if(!l) return 0;r\
  8. eturn!(_%l);}};void _(I o){I c=O<2>()(o)+O<1>()(o)+O<3>()(o);
  9. if(c==3)std::cout<<o<<'\n';}int main(){l<111,1000,_>()();}
  10.  
  11.  
Success #stdin #stdout 0s 4372KB
stdin
Standard input is empty
stdout
111
112
115
122
124
126
128
132
135
144
155
162
168
175
184
212
216
222
224
244
248
264
288
312
315
324
333
336
366
384
396
412
424
432
444
448
488
515
555
612
624
636
648
666
672
728
735
777
784
816
824
848
864
888
936
999