摘要: Description 自定义函数sort(int *p, int n),功能是对n个数排序。在main函数中,调用它,对输入的任意个数排序。 Input 多组测试数据,先输入n(n<100),再输入n个任意整数 Output 输出从小到大排列后的数组 阅读全文
posted @ 2018-11-28 23:35 MichaelCecil 阅读(4270) 评论(0) 推荐(1) 编辑
摘要: Description 调用自定义后移函数move(int *a, int n, int m)来进行循环移位,对n(n<20)个整数,使其前面各数顺序向后移m个位置,最后m个数变成最前面m个数,如下: n=10, m=3时:输入:1 2 3 4 5 6 7 8 9 10,输出:8 9 10 1 2 3 4 5 6 7 Input 输入多组测试数据,每组先输入n(n < 20)和m(m < n),再输入n个整数。 Output 输出循环移动m个数后的序列,数据间空格隔开。 阅读全文
posted @ 2018-11-28 22:56 MichaelCecil 阅读(12028) 评论(0) 推荐(3) 编辑
摘要: Description 自定义函数swap(float *p1, float *p2),调用它完成任意5个浮点数从小到大排列。 Input 多组测试数据,每组输入5个任意浮点数。 Output 输出从小到大排列的5个数,输出一位小数,数据之间空格隔开。 阅读全文
posted @ 2018-11-28 21:39 MichaelCecil 阅读(2194) 评论(0) 推荐(0) 编辑
摘要: Description 调用自定义交换函数swap(int *p1, int *p2),完成三个整数从小到大排列 Input 多组测试数据,每组输入三个任意整数 Output 输出从小到大排列的三个数 阅读全文
posted @ 2018-11-28 21:32 MichaelCecil 阅读(2037) 评论(0) 推荐(0) 编辑