Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- char str[255];
- int count = 0, i;
- printf("Insert: ");
- gets_s(str);
- for (i = 0; i < strlen(str) - 1; i++)
- if ((str[i] == ' ') && (str[i + 1] != ' '))
- count++;
- if (str[0] != ' ') count++;
- printf("\nConclusion: %d\n", count);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement