Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main () {
  5. char str[] = "This is a string. нннн";
  6. char * pch;
  7. int count = 0;
  8.  
  9. pch = strchr(str, 's');
  10.  
  11. while (pch != NULL) {
  12. count++;
  13. pch = strchr(pch + 1, 's');
  14. }
  15. printf("%i", count);
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement