23 lines
486 B
C++
23 lines
486 B
C++
|
#include<stdio.h>
|
||
|
#include<iostream>
|
||
|
|
||
|
|
||
|
int main() {
|
||
|
char input[10000];
|
||
|
int chars[26],i=0;
|
||
|
for(int j=0;j<26;j++)chars[j]=0;
|
||
|
printf("Input: ");
|
||
|
std::cin >>input;
|
||
|
while(input[i]!='\0') {
|
||
|
if(input[i]>=65&&input[i]<=90){
|
||
|
chars[(int)input[i]-65]++;
|
||
|
}
|
||
|
else if(input[i]>=97&&input[i]<=122){
|
||
|
chars[(int)input[i]-97]++;
|
||
|
}
|
||
|
i++;
|
||
|
}
|
||
|
for(i=0;i<26;i++) printf("%c : %d\n", i+65, chars[i]);
|
||
|
return 0;
|
||
|
}
|