home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #23 / NN_1992_23.iso / spool / sci / crypt / 3821 < prev    next >
Encoding:
Text File  |  1992-10-16  |  1.0 KB  |  36 lines

  1. Xref: sparky sci.crypt:3821 alt.security:4581
  2. Newsgroups: sci.crypt,alt.security
  3. Path: sparky!uunet!mcsun!sun4nl!nikhefk!keeshu
  4. From: keeshu@paramount.nikhefk.nikhef.nl (Kees Huyser)
  5. Subject: Re: Letter Frequency
  6. Message-ID: <1992Oct16.104858.12286@paramount.nikhefk.nikhef.nl>
  7. Organization: the National Institute for Nuclear Physics and High Energy Physics; the Netherlands
  8. References: <1992Oct15.181530.3802@a.cs.okstate.edu>
  9. Date: Fri, 16 Oct 1992 10:48:58 GMT
  10. Lines: 24
  11.  
  12. -----------------------<snip>--------------------
  13. #include <stdio.h>
  14.  
  15. int freq[256] = { 0 };
  16.  
  17. main()
  18. {    int c;
  19.  
  20.     while((c = getchar()) != EOF)
  21.     {    freq[c]++;
  22.     }
  23.     for(c = 'a'; c <= 'z'; c++)
  24.     {    printf("%d\t%c\n", freq[c], c);
  25.     }
  26. }
  27. -----------------------<snip>--------------------
  28.  
  29. try this,
  30. --kees
  31. -- 
  32. * Kees Huyser       (System Adminstrator and resident Macintosh Guru )  *
  33. * internet: keeshu@paramount.nikhefk.nikhef.nl         AppleLink: HOL0397 *
  34. * The National Institute for Nuclear Physics and High-Energy Physics, CSG/K *
  35. * P.O.Box 4395,  1009 AJ Amsterdam,  The Netherlands,    phone:+31205922132 *
  36.