2019年2月8日

最小差值

摘要: 问题描述 给定n个数,请找出其中相差(差的绝对值)最小的两个数,输出它们的差值的绝对值。输入格式 输入第一行包含一个整数n。 第二行包含n个正整数,相邻整数之间使用一个空格分隔。输出格式 输出一个整数,表示答案。样例输入51 5 4 8 20样例输出1样例说明 相差最小的两个数是5和4,它们之间的差 阅读全文

posted @ 2019-02-08 13:03 托马斯。成 阅读(295) 评论(0) 推荐(0)

模拟小球运动

摘要: //模拟,排序// #include<iostream>#include<algorithm>using namespace std;const int N = 100;struct Node{ int id;//小球编号// int pos;//位置// int step;//移动的速度// }b 阅读全文

posted @ 2019-02-08 12:13 托马斯。成 阅读(112) 评论(0) 推荐(0)

导航