42 lines
996 B
C
42 lines
996 B
C
|
#include <stdio.h>
|
||
|
#define ARR_LENGTH 37
|
||
|
|
||
|
int main(){
|
||
|
int cs[ARR_LENGTH] = {
|
||
|
'0', '1', '2', '3', '4', '5',
|
||
|
'6', '7', '8', '9', '0', 'a',
|
||
|
'b', 'c', 'd', 'e', 'f', 'g',
|
||
|
'h', 'i', 'j', 'k', 'l', 'm',
|
||
|
'n', 'o', 'p', 'q', 'r', 's',
|
||
|
't', 'u', 'v', 'w', 'x', 'y',
|
||
|
'z'
|
||
|
};
|
||
|
int cr[ARR_LENGTH];
|
||
|
for (int i=0; i<ARR_LENGTH; i++){
|
||
|
cr[i]=0;
|
||
|
}
|
||
|
int i, c, nr, index;
|
||
|
i = nr = index = 0;
|
||
|
while ((c = getchar()) != '\n' && i<ARR_LENGTH){
|
||
|
if (c != ' '){
|
||
|
for (index=0; index<ARR_LENGTH; index++){
|
||
|
if (cs[index]==c){
|
||
|
cr[index]++;
|
||
|
}
|
||
|
}
|
||
|
i++;
|
||
|
}
|
||
|
}
|
||
|
for(index=0; index<ARR_LENGTH; index++){
|
||
|
if (cr[index]!=0){
|
||
|
putchar(cs[index]);
|
||
|
putchar(' ');
|
||
|
for(i=0;i<cr[index];i++){
|
||
|
putchar('-');
|
||
|
}
|
||
|
putchar('\n');
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|