Advertisement
Teodora2310

Varianta 40

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