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