编程语言单选难度 3真题改编 · 2023
2678. #include <stdio.h>
void main()
{
int a[10]={1,2,3,4,5,6,7,8,9,0},*p;
p=a;
printf("%d",*p);
printf("%d\n",*(p+8));
}
输出结果是( )
练习本题 ›
算法与数据结构递归单选难度 3真题改编 · 2023
2699. 给定一组硬币面值 $C=\{1,5,10,25,60,100\}$ ,下面是用最少的硬币向客户支付金额的贪心算法,下列关于该贪心算法的叙述正确的是()
ALGORITHM (x, c1, c2, …, cn)//c1,c2..表示货币金额
SORT n coin denominations so that 0 < c1 < c2 < … < cn.
S ← ∅.//选择货币的集合
WHILE (x > 0)
k ← largest coin denomination ck such that ck <= x.
IF no such k, RETURN “no solution.”
ELSE
x ← x – ck.
S ← S ∪ { k }.
RETURN S.
练习本题 ›