fork download
  1. #include <string.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main ()
  6. {
  7. int z=0,n=0,i=0,j=0,o=0,k=0,l=0;
  8. char t[20000][31];
  9. char v[31];
  10. char s[31];
  11.  
  12.  
  13. scanf ("%d",&z);
  14.  
  15. for (l=1;l<=z;l++)
  16. {
  17.  
  18. scanf ("%d\n",&n);
  19.  
  20. for (j=0;j<=n-1;j++)
  21. {
  22. scanf ("%s",t[j]);
  23. strlwr(t[j]);
  24. }
  25.  
  26.  
  27.  
  28.  
  29. for (j=0;j<=n-1;j++)
  30. {
  31. k=0;
  32. strcpy(v,t[j]);
  33. for (i=j+1;i<=n-1;i++)
  34. {
  35. if (strcmp (t[i],v)<0)
  36. {
  37. strcpy(v,t[i]);
  38. k=i;
  39. }
  40. }
  41. if (k>0)
  42. {
  43. strcpy (s,t[j]);
  44. strcpy (t[j],v);
  45. strcpy (t[k],s);
  46. }
  47. }
  48.  
  49.  
  50.  
  51.  
  52. for (j=0;j<=n-1;j++)
  53. {
  54. printf ("%s ",t[j]);
  55. }
  56. printf ("\n");
  57. }
  58. return 0;
  59. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:13: warning: implicit declaration of function ‘scanf’
prog.c:13: warning: incompatible implicit declaration of built-in function ‘scanf’
prog.c:23: warning: implicit declaration of function ‘strlwr’
prog.c:54: warning: implicit declaration of function ‘printf’
prog.c:54: warning: incompatible implicit declaration of built-in function ‘printf’
prog.c:56: warning: incompatible implicit declaration of built-in function ‘printf’
prog.c:7: warning: unused variable ‘o’
/home/9q2J5a/ccZDUTUg.o: In function `main':
prog.c:(.text+0xa2): undefined reference to `strlwr'
collect2: ld returned 1 exit status
stdout
Standard output is empty