View Code of Problem 58

#include <stdio.h>
#include <string.h>
int main(){
  char a[100];
  gets(a);
  int len;
  len=strlen(a);
  int num=0;
  int i=0;
  while(i<len){
    if(a[i]>='a'&&a[i]<='z'||a[i]>='A'&&a[i]<='Z')
      num++;
    while(a[i]!=' '){
      i++;
    }
     i++; 
  }
  printf("%d\n",num);
  return 0;
}

Double click to view unformatted code.


Back to problem 58