Advertisement
Cucura_Georgiana

Varianta 40, Subiect 2

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