fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5. const int N = 100;
  6.  
  7. int main()
  8. {
  9. char text[N], wordarray[N][N], *p, delim[]= " ,";
  10. int n=0;
  11. printf("Enter text: \n");
  12. gets(text);
  13. p = strtok(text, delim);
  14.  
  15. while (p!= NULL)
  16. {
  17. strcpy(wordarray[n], p);
  18. n++;
  19. p = strtok(NULL, delim);
  20. }
  21. printf("Text result: \n");
  22. for(int i = 0; i<N; i++)
  23. {
  24. for(int j= i+1; j<N; j++)
  25. {
  26. if((strspn(wordarray[i], wordarray[j]) == strlen(wordarray[i])) && strlen(wordarray[i]) == strlen(wordarray[j]))
  27. puts(wordarray[i]);
  28. }
  29. }
  30. return 0;
  31. }
Success #stdin #stdout 0s 5416KB
stdin
Standard input is empty
stdout
Enter  text: 
Text result: 











































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































�
�
�
�
�
�






































































�
�
�
�
�











































































�
�
�
�

















�
�
�













�
�









�