Advertisement
saidnagi

Number of words

Mar 27th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4.     string a;
  5.     int s=0;
  6. while(cin>>a){
  7.         if(a[0]!=',' and a[0]!='.' and a[0]!='!' and a[0]!='?' and a[0]!='-'){
  8.             s++;
  9.         }
  10.     }
  11.     cout<<s<<endl;
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement