Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. char s[101],aux[101],aux1[300],v[101][101],*p,sep[]=",?. ";
  7. int l1,n,poz,l,i,j,nr,aux2,nrcuv,ap[100];
  8.  
  9. int main()
  10. {cin.getline(s,101);
  11. p=strtok(s,sep);
  12. n=0;
  13. while(p)
  14. {
  15.  
  16. ++n;
  17. strcpy(v[n],p);
  18.  
  19.  
  20. p=strtok(NULL,sep);
  21. }
  22. nr=0;
  23. for(i=1;i<=n;++i)
  24.  
  25. if(strlen(v[i])%2)
  26. { for(j=1;j<=n;++j)
  27. {strcpy(aux,v[j]);
  28. l=strlen(v[j]);
  29. strcpy(aux+l/2,aux+l/2+1);
  30. if(strcmp(v[i],aux)==0)
  31. ++nr;
  32. }
  33.  
  34. }
  35. if(nr!=0)
  36. cout<<"DA";
  37. else
  38. cout<<"NU";
  39.  
  40.  
  41.  
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement