Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.programming Subject: Re: Long winter evenings Date: Mon, 04 Nov 2019 22:24:48 +0000 Organization: A noiseless patient Spider Lines: 10 Message-ID: <87eeynjn4f.fsf@bsb.me.uk> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="e0eb4ca205b0748ecaaa72661425f5df"; logging-data="11171"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/CPYwyAgiaKrActGoMBey9GVcvGI00P0=" Cancel-Lock: sha1:Ey89F1HsG9tNz7tDsjKM9wKehDQ= sha1:p1/hmhsDqKFecBzwIQ9nFWYB11E= X-BSB-Auth: 1.90d9bcef5ba95f8e4cef.20191104222448GMT.87eeynjn4f.fsf@bsb.me.uk Xref: csiph.com comp.programming:10280 David Brown writes: > #include > int main(void){int n=0,d=0,c,f,i;while(!d){++n;c=n,f=1;for(i=0;f&&i<5;i++)f=(c%5==1)?c/=5,c*=4,1:0;d=f*!(c%5);};printf("%d\n",n);return 0;} When reducing code, two standard tricks are to move declarations to file scope so you don't need the zero initialisation, and return!printf(...); -- Ben.