摘要: 1023. 组个最小数 (20) 给定数字0 9各若干个。你可以以任意顺序排列这些数字,但必须全部使用。目标是使得最后得到的数尽可能小(注意0不能做首位)。例如:给定两个0,两个1,三个5,一个8,我们得到的最小的数就是10015558。 现给定数字,请编写程序输出能够组成的最小的数。 输入格式: 阅读全文
posted @ 2017-12-19 21:04 A-Little-Nut 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 1022. D进制的A+B (20) 输入两个非负10进制整数A和B(123 456 8 输出样例: 1103 这题也比较简单,下面是代码 include include using namespace std; int main(){ int n1,n2,n,N; cin n1 n2 n; N=n 阅读全文
posted @ 2017-12-19 20:09 A-Little-Nut 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 1021. 个位数统计 (15) 给定一个k位整数N = dk 1 10k 1 + ... + d1 101 + d0 (00),请编写程序统计每种不同的个位数字出现的次数。例如:给定N = 100311,则有2个0,3个1,和1个3。 输入格式: 每个输入包含1个测试用例,即一个不超过1000位的 阅读全文
posted @ 2017-12-19 19:13 A-Little-Nut 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 7 16 Sort with Swap(0, i)(25 分) Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap 阅读全文
posted @ 2017-12-19 18:01 A-Little-Nut 阅读(757) 评论(0) 推荐(0) 编辑