Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main(){
- char w[10000];
- char *word;
- int t;
- cin>>t;
- int count = 0 ;
- for (int i = 0 ; i < t; i++)
- {
- scanf(" %[^\n]",w);
- // cout <<w<<endl;
- count = 0;
- word = strtok(w,",!;?. ");
- cout <<word<< " " <<w<<endl;
- while(word!=NULL)
- {
- if(strlen(word)>0){
- count++;
- }
- word = strtok(NULL,",!;?. ");
- cout<<word<< " " <<w<<endl;
- }
- cout<<"count : " << count<<endl;
- }
- }
Add Comment
Please, Sign In to add comment