Login
Immutable PageDiscussionInfoAttachments
Diff for "rei05/C言語"

MMA
Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2012-05-08 17:39:22
Size: 443
Editor: rei05
Comment:
Revision 3 as of 2012-05-08 17:46:05
Size: 440
Editor: rei05
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
 * AOJ10020番WrongAnswer  * AOJ10020番WrongAnswer
Line 5: Line 5:
#Comment #comment

=Help Me!=

#comment

#include<stdio.h>

int main(){

int num,i,pri;
char ch,counter[256]={0};

while(1){
  scanf("%c",&ch);
    if(ch=='\n') break;
  if('a'<=ch&&ch<='z'){
    num=ch-'a';
    counter[num]++;
  }else if('A'<=ch&&ch<='Z'){
    num=ch-'A';
    counter[num]++;
  }
}

for(i=0;i<=25;i++){
  pri=counter[i];
  printf("%c : %d\n",i+'a',pri);
}

return(0);
}

rei05/C言語 (last edited 2012-07-16 17:50:37 by nomeaning)