Advertisement
aiNayan

494

Dec 27th, 2020
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main()
  4. {
  5. int i, l, count=0;
  6. char str[100];
  7. gets(str);
  8. l = strlen(str);
  9. for (i = 0; i <= l; i++)
  10. {
  11. if ((str[i] >= 'A' && str[i] <= 'Z') || (str[i] >= 'a' && str[i] <= 'z'))
  12. {
  13. count++;
  14. while ((str[i] >= 'A' && str[i] <= 'Z') || (str[i] >= 'a' && str[i] <= 'z'))
  15. {
  16. i++;
  17. }
  18. }
  19. }
  20. printf("%d\n", count);
  21. return 0;
  22. }
  23.  
  24.  
  25.  
  26. 494
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement