fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int n,i,j,k,x,y;
  6. char a[10][10],b[10][10],l[10];
  7. cout<<"enter the no. of text";
  8. cin>>n;
  9. for (i=0;i<n;i++)
  10. {
  11. gets(a[i]);
  12. l[i]=strlen(a[i]);
  13. }
  14.  
  15. for (i=0;i<n;i++)
  16. {for (j=0;j<l[i];j++)
  17. {for(k=0;k<j;k++)
  18. {if(a[i][j]==a[i][k])
  19. {
  20. for(x=j;x<l[i]-1;x++)
  21. a[i][x]=a[i][x+1];
  22. a[i][x]=' ';
  23. j--;
  24. l[i]--;
  25. }
  26. }
  27. }
  28. puts(a[i]);
  29. }
  30. }
Success #stdin #stdout 0s 3300KB
stdin
Standard input is empty
stdout
enter the no. of text