home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 18817 < prev    next >
Encoding:
Text File  |  1992-12-23  |  1.3 KB  |  30 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!uunet.ca!wildcan!sq!msb
  3. From: msb@sq.sq.com (Mark Brader)
  4. Subject: Re: A different C puzzle
  5. Message-ID: <1992Dec23.092712.2408@sq.sq.com>
  6. Summary: impossible
  7. Organization: SoftQuad Inc., Toronto, Canada
  8. References: <768@ulogic.UUCP>
  9. Date: Wed, 23 Dec 92 09:27:12 GMT
  10. Lines: 18
  11.  
  12. > > Write a [C] program that uses every valid character exactly once.
  13. > I should think it would be rather difficult to use only one " ...
  14.  
  15. You could manage that with a #define or a character constant, but each
  16. of those also involves a repeated character (e or ') and so is ruled
  17. out.  I think it's clear that the problem has no solution that is a
  18. strictly conforming ANSI C program.  You must have a "main()", and that
  19. already means that (a) you can't call any other functions (parentheses);
  20. and (b) you can't have a return statement (two r's).  So you can't
  21. terminate in a permissible way.  I note in addition that every
  22. preprocessor directive either has a letter in common with "main"
  23. or has a repeated letter; thus no preprocessor tricks could be used.
  24. -- 
  25. Mark Brader            "Howeb45 9 qad no5 und8ly diturvrd v7 7jis dince
  26. SoftQuad Inc., Toronto         9 qas 8mtillihemt mot ikkfavpur4d 5esoyrdeful
  27. utzoo!sq!msb, msb@sq.com     abd fill if condif3nce on myd3lf."      -- Cica
  28.  
  29. This article is in the public domain.
  30.