What is Nostr?
/
npub1psx…gvsy
2023-09-16 06:24:52
in reply to nevent1q…ynha

​ on Nostr: theo h. mann Matoi:z:Ryuko:shrussia: C++ is very easy, just enum{START=1,END=500,}; ...

theo h. mann (npub17dy…yf4p) Matoi:z:Ryuko:shrussia: (npub1xan…jlvy) C++ is very easy, just

enum{START=1,END=500,};
#define u using
#define C const
#define S struct
#define P putchar
#define t template
#define CE constexpr
#define st static
#define R return
#define F(x,a...) for(x)a
#define A auto
u I=int;u c=char;u s=long unsigned;extern "C" I P(I);
t<s N=1,s M=1>S m{
st CE A f=[](s n,s m)CE{s mt=n/m;R n-mt*m;};
st CE s v=f(N,M);
};
t<s N>S tg{u L=c[N];L d;
CE tg(L C& sl){F(s i=0;i<N;++i,d[i]=sl[i];)}};
t<s N>tg(c C(&)[N])->tg<N>;
t<s,tg,I>S ps{};
t<s N,tg T>S ps<N,T,0>{ps(){F(s i=0;P(T.d[i++]);,;)}};
t<s,I>S pn{};
t<s N>S pn<N,0>{pn(){
s sz=1;
F(s i=N;i/=10;++sz,;)
F(s i=sz;i;--i,{
s r=1;F(s j=i-1;j;--j,r*=10;)
P('0'+m<>::f(N/r,10));
})
}};
t<s N>S p{p(){
ps<N,"Fizz",m<N,3>::v>{};
ps<N,"Buzz",m<N,5>::v>{};
pn<N,!m<N,3>::v+!m<N,5>::v>{};
P(10);
}};
t<s N,s E>S fb:p<N>{fb(){fb<N+1,E>{};}};
t<s N>S fb<N,N>:p<N>{};
I main(){fb<START,END>{};}
Author Public Key
npub1psx7zml4neu6v03fe6pqcdp4lvcf444mfswy4rlfz28s8jwtzjtqrxgvsy