Advertisement
catalyn

stergere so

Jan 21st, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include<cstring>
  3. using namespace std;
  4. char s[256];
  5.  
  6. int main()
  7. {
  8. cin.getline(s,256);
  9. char *p ,nou[256]={0};
  10. p=strtok(s," ");
  11. while(p)
  12. {
  13. strcat(nou,p);
  14. strcat(nou," " );
  15. p=strtok(NULL," ");
  16. }
  17. nou[strlen(nou)-1]=NULL;
  18. cout<<nou;
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement