Advertisement
fqrmix

Help

Oct 21st, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main()
  4. {
  5.     char mus[100];
  6.     int i = 0, k = 0;
  7.     printf("Введите строку\n");
  8.     gets_s(mus);
  9.     while (mus[i] != '\0'){
  10.         if (mus[i] == ' ' && mus[i+1] != ' ')
  11.             k++;
  12.         i++;
  13.     }
  14.     printf("%d\n", k+1);
  15.     system("pause");
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement