fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <math.h>
  5. int main()
  6. {
  7. int n,kt,dem=0,i,j,a[128];
  8. char s[1000],tam;
  9. for (i=0;i<127;i++) a[i]=0;
  10. fgets(s,1000,stdin);
  11. if (s[strlen(s)-1]=='\n') s[strlen(s)-1]='\0';
  12. for (i=0;i<strlen(s);i++)
  13. {
  14. if (s[i]>='A'&&s[i]<='Z') s[i]=s[i]+32;
  15. a[s[i]]++;
  16. }
  17.  
  18. //puts(s);
  19. for (i=0;i<strlen(s)-1;i++)
  20. for (j=i+1;j<strlen(s);j++)
  21. if (s[i]>s[j])
  22. {
  23. tam=s[i];
  24. s[i]=s[j];
  25. s[j]=tam;
  26. }
  27.  
  28. for (i=0;i<strlen(s);i++)
  29. {
  30. if (a[s[i]]>0) printf("%c: %d\n",s[i],a[s[i]]);
  31. a[s[i]]=0;
  32. }
  33. return 0;
  34. }
Success #stdin #stdout 0s 5492KB
stdin
Standard input is empty
stdout
: 1