Print? Description
Description
A matrix consisting of N x N (both length and width are N) consisting of lowercase English letters is provided. It is required that each row be sorted in alphabetical order and then output after being reversed.
Input
The input contains N + 1 rows. The first row is an integer N, followed by a string of N rows with a length of N. Where 0 <N <= 100, all letters are lowercase letters.
Output
The Phalanx after each row is sorted and reversed.
Sample Input
3
Abc
Edf
Weigh
Sample Output
Ghi
Def
Abc
[Plain]
# Include <stdio. h>
Int main (){
Int I;
Int j;
Int n;
Int l;
Int t;
Char array [101] [101];
While (scanf ("% d", & n )! = EOF & (n> 0 & n <= 100 ))
{For (I = 0; I <n; I ++)
{Scanf ("% s", array [I]);
} For (I = 0; I <n; I ++)
{For (j = 0; j <n-1; j ++)
{For (l = j + 1; l <n; l ++)
{
If (array [I] [j]> array [I] [l])
{
T = array [I] [j];
Array [I] [j] = array [I] [l];
Array [I] [l] = t;
}}
}}
For (I = n-1; I> = 0; I --){
For (j = 0; j <n; j ++)
{Printf ("% c", array [I] [j]);
} Printf ("\ n ");
} Return 0;
} # Include <stdio. h>
Int main ()
{
Int I;
Int j;
Int n;
Int l;
Int t;
Char array [101] [101];
While (scanf ("% d", & n )! = EOF & (n> 0 & n <= 100 ))
{
For (I = 0; I <n; I ++)
{
Scanf ("% s", array [I]);
}
For (I = 0; I <n; I ++)
{
For (j = 0; j <n-1; j ++)
{
For (l = j + 1; l <n; l ++)
{
If (array [I] [j]> array [I] [l])
{
T = array [I] [j];
Array [I] [j] = array [I] [l];
Array [I] [l] = t;
}
}
}
}
For (I = n-1; I> = 0; I --)
{
For (j = 0; j <n; j ++)
{
Printf ("% c", array [I] [j]);
}
Printf ("\ n ");
}
}
Return 0;
}