fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int i;
  5. int countn = 0, countc = 0, counte = 0;
  6.  
  7. char s[1024] = "abfv 21 f vfgreqgq21";
  8. while (1) {
  9. //printf("input message for check: ");
  10. //gets(s);
  11. for (i=0; s[i]!='\0'; i++) {
  12. if (s[i] >= 48 && s[i] <= 57) {
  13. countn++;
  14. }
  15. else if (s[i] >= 65 && s[i] <= 90) {
  16. countc++;
  17. }
  18. else if (s[i] >= 97 && s[i] <= 122) {
  19. countc++;
  20. }
  21. else if (s[i] == 32) {
  22. counte++;
  23. }
  24. }
  25. printf("count of number: %d\n", countn);
  26. printf("count of character: %d\n", countc);
  27. printf("count of empty(sapce): %d\n", counte);
  28. break;
  29. }
  30.  
  31. return 0;
  32. }
Success #stdin #stdout 0s 1720KB
stdin
Standard input is empty
stdout
count of number: 4
count of character: 13
count of empty(sapce): 3