Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- #include <iostream>
- #include <string>
- #include <fstream>
- int main ()
- {
- char c[255] , sep[8]=" ,.;:!?" , aux[255];
- char *p , *q;
- int i;
- ifstream fin ("text.in");
- fin.get (c , 255);
- fin.close ();
- strcpy (aux , c);
- p=strtok (c,sep);
- while (p)
- {
- cout<<p<<endl;
- while (aux);
- {
- cout<<aux<<endl;
- q=strtok (NULL , sep);
- }
- p=strtok (NULL , sep);
- }
- cout<<endl;
- cout<<endl;
- q=strtok (aux , sep);
- while (aux);
- {
- cout<<aux<<endl;
- q=strtok (NULL , sep);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment