fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. char *string = "aouihuiahsudasduihqmdoiqjnduiamsdoqnwuidamodkjwodkaposdj";
  5. int quantidade[26] = { 0 };
  6. for (; *string != '\0'; string++) {
  7. quantidade[*string - 'a']++;
  8. }
  9. for (int i = 0; i < 26; i++) {
  10. printf("%c => %d\n", i + 'a', quantidade[i]);
  11. }
  12. }
  13.  
  14. //https://pt.stackoverflow.com/q/217720/101
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
a => 6
b => 0
c => 0
d => 9
e => 0
f => 0
g => 0
h => 3
i => 6
j => 3
k => 2
l => 0
m => 3
n => 2
o => 6
p => 1
q => 3
r => 0
s => 4
t => 0
u => 6
v => 0
w => 2
x => 0
y => 0
z => 0