摘要: Problem Description输入n(n<100)个数,找出其中最小的数,将它放在首位,剩下的数保持原来次序不变!nput输入数据有多组,每组占一行,每行的开始是一个整数n,表示这个测试实例的数值的个数,跟着就是n个整数。n=0表示输入的结束,不做处理。Output对于每组输入数据,输出交换后的数列,每组输出占一行。Sample Input4 2 1 3 45 5 4 3 2 10Sample Output1 2 3 41 5 4 3 2#include<stdio.h>#include<stdlib.h>void main(){ int n,i,j; 阅读全文
posted @ 2011-06-18 19:52 又是一年夏天 阅读(311) 评论(0) 推荐(0)
摘要: Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds to move down one floor. The 阅读全文
posted @ 2011-06-18 18:35 又是一年夏天 阅读(527) 评论(0) 推荐(0)