#Lutece0962. 平面点排序
平面点排序
Migrated from Lutece 962 平面点排序
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
平面上有个点,坐标均为整数。横坐标相同时按纵坐标排序,否则按横坐标排序。输出排序后的结果。本题要求用结构体存储坐标,再进行排序。排序用两种方法,一种自己写排序函数,升序输出。另一种用qsort库函数排序,降序输出。
Input
输入有两行,第一行是整数,表示下一行有对整数(每对整数对应一个点)输入,每个数据后有一个空格。
Output
输出有两行,即排序后的点,格式为,每个点后有一个空格。第一行升序排序结果,第二行降序排序结果。
Samples
4
1 3 2 5 1 4 4 1
(1,3) (1,4) (2,5) (4,1)
(4,1) (2,5) (1,4) (1,3)
Resources
wxiaoping 2009年C语言第七次上机