发布时间 : 星期一 文章oj库更新完毕开始阅读ce22a56c27d3240c8447ef64
Source
指针:调用自定义交换函数,完成三个数整从小到大
排列
Time Limit:1000MS Memory Limit:65536K
Total Submit:1609 Accepted:1104
Description
调用自定义交换函数swap(int *p1, int *p2),完成三个整数从小到大排列
Input
多组测试数据,每组输入三个任意整数
Output
输出从小到大排列的三个数
Sample Input
9 2 7 0 -2 12 8 3 1
Sample Output
2 7 9 -2 0 12 1 3 8
Source
指针:调用自定义交换函数,完成5个浮点数从小到
大排列
Time Limit:1000MS Memory Limit:65536K
Total Submit:1483 Accepted:884
Description
自定义函数swap(float *p1, float *p2),调用它完成任意5个浮点数从小到大排列。
Input
多组测试数据,每组输入5个任意浮点数。
Output
输出从小到大排列的5个数,输出一位小数,数据之间空格隔开。
Sample Input
5.5 4.4 3.3 2.2 1.1 3.1 2 0 7.2 5.4 7.2 -3.4 0 -2 1.2
Sample Output
1.1 2.2 3.3 4.4 5.5 0.0 2.0 3.1 5.4 7.2 -3.4 -2.0 0.0 1.2 7.2
Source
指针:有n个整数,使其前面各数顺序向后移m个位
置,最后m个数变成最前面m个数
Time Limit:1000MS Memory Limit:65536K
Total Submit:835 Accepted:646
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个数后的序列,数据间空格隔开。
Sample Input
10 4
1 2 3 4 5 6 7 8 9 10 7 2
1 2 3 4 5 6 7
Sample Output
7 8 9 10 1 2 3 4 5 6 6 7 1 2 3 4 5
Source
输入3个字符串,按由小到大顺序输出
Time Limit:1000MS Memory Limit:65536K
Total Submit:1969 Accepted:1195
Description
输入3个字符串(长度都小于80),按由小到大顺序输出。
Input
多组测试数据,每组输入三个字符串。
Output
按从小到大输出三个字符串。
Sample Input
oh my god China Beijing Hangzhou
Sample Output
god my oh
Beijing China Hangzhou
Source
指针:自定义函数length,调用它计算字符串的长度
Time Limit:1000MS Memory Limit:65536K
Total Submit:1011 Accepted:761