fork download
  1. #include <stdio.h>
  2. #include<string.h>
  3. int main(void) {
  4. // your code goes here
  5. int d=0;
  6. char s[1000];
  7. scanf("%s",s);
  8. char arr[]={'0','1','2','3','4','5','6','7','8','9'};
  9. for(int i=0;i<10;i++){
  10. for(int j=0;j<strlen(s);j++){
  11. if(s[j]==arr[i]){
  12. d++;
  13.  
  14. }
  15. }
  16. printf("%d",d);
  17. }
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5564KB
stdin
a11472o5t6
stdout
0233456777