Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int careht_1=0;
- int a=0;
- char w[100];
- cout << "Type the words:";
- cin.getline(w, 99);
- if(w[0] >='a'&& w[0] <='z')
- {
- a++;
- }
- while (w[careht_1] > 0)
- {
- if ((w[careht_1]<'a')|| (w[careht_1]>'z'))
- {
- a++;
- if ((w[careht_1+1]<'a')|| (w[careht_1+1]>'z') || (w[careht_1]==0))
- {
- a=a-1;
- }
- }
- careht_1++;
- }
- cout <<a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement