Results 1 to 3 of 3

Thread: EOF -

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Jun:2010
    Location:
    Posts: 171

    EOF -

    , EOF , Windows dev C++

    Code:
    #include <stdio.h>
    int main(int argc,char *argv[])
    {
      int counts[26]={0};  
      int cypherChar=getchar();
      while(cypherChar!=EOF)
      {
        if(islower(cypherChar))
        {
          counts[cypherChar-'a']++;                     
        }  
        cypherChar=getchar();                 
      }
        printf("Freqency table\n");
        int i='a';
        while(i<='z')
        {
          printf("%c %d\n",i,counts[i-'a']);
          i++;           
        }
        return 0;
    }
    Last edited by lludmill; 19th July 2010 at 21:52.

  2. #2
    Registered abUser ike's Avatar
    Join Date: Jul:2004
    Location: sofi
    Posts: 4,965
    Have no fear ike iz here.
    CPU Cx486DLC@40MHz, RAM 4MB, VGA Trident 512KB, HDD Conner 160MB, Monitor 14" Color

  3. #3
    Registered User
    Join Date: Jun:2010
    Location:
    Posts: 171
    enter control+Z enter
    a a
    Last edited by lludmill; 19th July 2010 at 22:15.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |