home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19236 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1.6 KB  |  53 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!pipex!warwick!coventry!champion
  3. From: champion@cch.coventry.ac.uk (Alun)
  4. Subject: Re: A different C puzzle
  5. Message-ID: <C0DKAx.I8A@cck.coventry.ac.uk>
  6. Sender: news@cck.coventry.ac.uk (news user)
  7. Nntp-Posting-Host: cc_sysh
  8. Organization: Coventry University, Coventry, UK.
  9. References: <768@ulogic.UUCP> <1992Dec23.092712.2408@sq.sq.com> <1992Dec23.185348.19343@sharebase.com>
  10. Date: Tue, 5 Jan 1993 09:42:33 GMT
  11. Lines: 40
  12.  
  13. In article <1992Dec23.185348.19343@sharebase.com> keith@torme.sharebase.com (Keith Chambless) writes:
  14. ~In article <1992Dec23.092712.2408@sq.sq.com> msb@sq.sq.com (Mark Brader) writes:
  15. ~>> > Write a [C] program that uses every valid character exactly once.
  16. ~>> I should think it would be rather difficult to use only one " ...
  17. ~
  18. ~Best I could come up with is:
  19. ~
  20. ~#
  21. ~
  22. ~main()
  23. ~{
  24. ~    double *ABCDEFGHIJKLMNOPQRSTUVWXYZ[],
  25. ~           c_fghjkpqrstvwxyz = -!9 + 8.0 / 7 > 6 < 5 % 4 ? 3 : 2 & 1;
  26. ~}
  27. ~
  28. ~
  29. ~missing are ' " \
  30.  
  31. What about ^ | ~
  32. Also it doesn't seem to compile - it complains about no size for the array.
  33.  
  34. #
  35. double *ABCDEFGHIJKLMNOPQRSTUVWXYZ[],
  36.        c_fghjkpqrstvwxyz = -!9 ^ +8. / 7 > 6 < 5 % 4 ? 3 : 2 & 1 | ~0;
  37.  
  38. main()
  39. { }
  40.  
  41. Sticking the double as global does compile with gcc -ansi and I have added the
  42. other operators.
  43.  
  44. I can't see any way of gettting the ' " \ into the program.
  45.  
  46.   -Alun
  47.   
  48. -- 
  49.   *I'm as bad as the worst - but thank God(?) I am as good as the best.*
  50.     *People who think they know everything annoy those of us that do.*
  51. A.Champion                |  That's an interesting point, in the sense of
  52. (champion@uk.ac.cov.cch)  |    being very not interesting at all. - The Liar
  53.