Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #10280
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
| 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> (permalink) |
| References | <qppnk6$584$1@dont-email.me> <qpq5r8$t8i$1@dont-email.me> |
| 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 |
Show key headers only | View raw
David Brown <david.brown@hesbynett.no> writes:
> #include <stdio.h>
> 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.
Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Long winter evenings Richard Heathfield <rjh@cpax.org.uk> - 2019-11-04 17:37 +0000
Re: Long winter evenings David Brown <david.brown@hesbynett.no> - 2019-11-04 22:39 +0100
Re: Long winter evenings Richard Heathfield <rjh@cpax.org.uk> - 2019-11-04 21:51 +0000
Re: Long winter evenings David Brown <david.brown@hesbynett.no> - 2019-11-05 10:42 +0100
Re: Long winter evenings Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-04 22:24 +0000
Re: Long winter evenings Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-04 22:19 +0000
Re: Long winter evenings Richard Heathfield <rjh@cpax.org.uk> - 2019-11-04 22:30 +0000
Re: Long winter evenings Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-04 23:59 +0000
Re: Long winter evenings Richard Heathfield <rjh@cpax.org.uk> - 2019-11-05 01:03 +0000
Re: Long winter evenings Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-05 04:01 +0000
Re: Long winter evenings Richard Heathfield <rjh@cpax.org.uk> - 2019-11-05 07:42 +0000
Re: Long winter evenings Melzzzzz <Melzzzzz@zzzzz.com> - 2019-11-04 23:00 +0000
Re: Long winter evenings Tim Rentsch <tr.17687@z991.linuxsc.com> - 2019-11-06 04:58 -0800
csiph-web