2024-01-31 08:15:04 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2024-02-04 12:00:33 +00:00
|
|
|
int cmp_str(const void *s1, const void *s2);
|
2024-01-31 08:15:04 +00:00
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
int i;
|
2024-02-04 12:00:33 +00:00
|
|
|
int n;
|
|
|
|
int l;
|
|
|
|
char s[100][100 + 1];
|
2024-01-31 08:15:04 +00:00
|
|
|
|
2024-02-04 12:00:33 +00:00
|
|
|
scanf("%d %d", &n, &l);
|
2024-01-31 08:15:04 +00:00
|
|
|
i = 0;
|
2024-02-04 12:00:33 +00:00
|
|
|
while (i < n)
|
2024-01-31 08:15:04 +00:00
|
|
|
{
|
2024-02-04 12:00:33 +00:00
|
|
|
scanf("%s", s[i]);
|
2024-02-04 11:54:18 +00:00
|
|
|
i++;
|
2024-01-31 08:15:04 +00:00
|
|
|
}
|
2024-02-04 12:00:33 +00:00
|
|
|
qsort(s, n, sizeof(s[0]), cmp_str);
|
2024-01-31 08:15:04 +00:00
|
|
|
i = 0;
|
2024-02-04 12:00:33 +00:00
|
|
|
while (i < n)
|
2024-01-31 08:15:04 +00:00
|
|
|
{
|
2024-02-04 12:00:33 +00:00
|
|
|
printf("%s", s[i]);
|
2024-02-04 11:54:18 +00:00
|
|
|
i++;
|
2024-01-31 08:15:04 +00:00
|
|
|
}
|
|
|
|
puts("");
|
|
|
|
}
|
|
|
|
|
2024-02-04 12:00:33 +00:00
|
|
|
int cmp_str(const void *s1, const void *s2)
|
2024-01-31 08:15:04 +00:00
|
|
|
{
|
2024-02-04 12:00:33 +00:00
|
|
|
return (strcmp(s1, s2));
|
2024-01-31 08:15:04 +00:00
|
|
|
}
|