Denistod

Untitled

Nov 18th, 2019
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4. char *p,cuvant[100],R[256],x[256];
  5. int main()
  6. {
  7. cin.getline(x,256);
  8. p=strtok(x,"*");
  9. strcpy(cuvant,p);
  10. while(p!=0)
  11. {
  12. if(strcmp(p,cuvant)!=0)
  13. {
  14. strcat(R,p);
  15. }
  16. strcat(R,"*");
  17. p=strtok(0,"*");
  18. }
  19. cout<<R;
  20. return 0;
  21. }
  22. v40
Add Comment
Please, Sign In to add comment