Login
Immutable PageDiscussionInfoAttachments
rei05/C言語/10020

MMA

   1 include<stdio.h>
   2 
   3 int main(){
   4 
   5 int num,i,pri,counter[26]={0};
   6 char ch;
   7 
   8 while(scanf("%c",&ch)!=EOF){
   9   if('a'<=ch&&ch<='z'){
  10     num=ch-'a';
  11     counter[num]++;
  12   }else if('A'<=ch&&ch<='Z'){
  13     num=ch-'A';
  14     counter[num]++;
  15   }
  16 }
  17 
  18 for(i=0;i<=25;i++){
  19   printf("%c : %d\n",i+'a',counter[i]);
  20 }
  21 
  22 return(0);
  23 }

rei05/C言語/10020 (last edited 2012-05-12 01:33:16 by rei05)