Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- #include <cctype>
- using namespace std;
- int main()
- {
- int i,j,n=0 ;
- char Q1[100];
- string Q = "Must you be so linear, Jean-Luc 0 123";
- cin.getline(Q1, 99);
- cout<<endl<<endl;
- if(strlen(Q1) > 1)
- Q = Q1;
- for(i=0; i<100; i++)
- {
- if (Q[i]=='\0')
- break;
- string a;
- if (isalpha(Q[i]))
- {
- for(j=i; j<100; j++)
- {
- if (isdigit(Q[j])||(ispunct(Q[j])&&Q[j]!='-'))
- continue;
- a=a+Q[j];
- if (isspace(Q[j]))
- {
- cout<<++n<<". : ["<<a<<"]"<<endl;
- i=j;
- break;
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement