Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <cstring>
- using namespace std;
- int main()
- {
- char s[100];
- unsigned n, i, nr = 1;
- gets(s);
- n = strlen(s);
- for (i = 0; i < n; i++)
- if ((s[i] == ' ' || s[i] == '.' || s[i] == ',') && s[i+1])
- nr++;
- cout << "textul are " << nr << " cuvinte.";
- return 0;
- }
Add Comment
Please, Sign In to add comment