曼珠沙华(转载二)# paladin - 谈古论金,黄梁一梦
A*3
1 楼
1. Write a function that takes an array of five integers, each of which
is between 1 and 10, and returns the number of combinations of those
integers that sum to 15. For example, calling the function with the array [
1, 2, 3, 4, 5] should return 1, while calling it with [5, 5, 10, 2, 3]
should return 4 (5 + 10, 5 + 10, 5 + 5 + 2 + 3, 10 + 2 + 3). You may assume
that the input has already been validated. Show how you would test this
function.
2. Write a function to shuffle a deck of 52 c
is between 1 and 10, and returns the number of combinations of those
integers that sum to 15. For example, calling the function with the array [
1, 2, 3, 4, 5] should return 1, while calling it with [5, 5, 10, 2, 3]
should return 4 (5 + 10, 5 + 10, 5 + 5 + 2 + 3, 10 + 2 + 3). You may assume
that the input has already been validated. Show how you would test this
function.
2. Write a function to shuffle a deck of 52 c