Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void counter(int zliczacz [256],char input [100]) ;
- void statystyka(int zliczacz [256]) ;
- int main()
- {
- char input [100] ;
- int zliczacz [256] ;
- counter(zliczacz, input) ;
- statystyka(zliczacz) ;
- return 0;
- }
- void counter(int zliczacz [256],char input [100])
- {
- int c ;
- for(int i = 0 ; i < 256; i++)
- zliczacz [i] = 0;
- for(int i = 0; (c = getchar()) != EOF && i < 100 && c != '\n'; i++)
- {
- input [i] = c ;
- zliczacz [input[i]]++ ;
- }
- }
- void statystyka(int zliczacz [256])
- {
- for(int i = 0; i < 256; i++)
- printf("%c\t%d\t%d\n", i, i, zliczacz[i]) ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement