Guest User

Untitled

a guest
Feb 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. using namespace std;
  2. #include <iostream>
  3. #include <string>
  4. #include <fstream>
  5.  
  6. int main ()
  7. {
  8. char c[255] , sep[8]=" ,.;:!?" , aux[255];
  9. char *p , *q;
  10. int i;
  11. ifstream fin ("text.in");
  12. fin.get (c , 255);
  13. fin.close ();
  14. strcpy (aux , c);
  15. p=strtok (c,sep);
  16. while (p)
  17. {
  18. cout<<p<<endl;
  19. while (aux);
  20. {
  21. cout<<aux<<endl;
  22. q=strtok (NULL , sep);
  23. }
  24. p=strtok (NULL , sep);
  25. }
  26. cout<<endl;
  27. cout<<endl;
  28. q=strtok (aux , sep);
  29. while (aux);
  30. {
  31. cout<<aux<<endl;
  32. q=strtok (NULL , sep);
  33. }
  34. return 0;
  35. }
Add Comment
Please, Sign In to add comment