Advertisement
fqrmix

Untitled

Nov 4th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int res(char str2[10])
  4. {
  5.     int res = 0;
  6.     char *p;
  7.     p = &str2[0];
  8.     for (int i = 0; i<10; i++)
  9.     {
  10.         if (*(p + i) == 'н'&& *(p + i + 1) == 'е')
  11.             res++;
  12.     }
  13.     return res;
  14. }
  15.  
  16. int main(void)
  17. {
  18.     char str[10];
  19.     int i = 0, res1;
  20.     printf("ввести строку мeеньше10 символов\n");
  21.     gets_s(str);
  22.  
  23.     res1 = res(str);
  24.     printf("res=%d", res1);
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement