✔ 最佳答案
You can use the principle of inclusion and exclusion.
First add all the numbers in that range that are divisible by 10. Obviously every 10th number (10, 20, 30, ...) is divisible by 10.
100 / 10 = 10 numbers
Next add all the numbers in that range that are divisible by 7. Obviously every 7th number (7, 14, 21, ...) is divisible by 7.
100 / 7 = 14 2/7 --> round down to 14 numbers
So it would seem you have 10 + 14 = 24 numbers
But wait! You accidentally double-counted at least one number. If a number is divisible by 10 *and* 7, then it was counted in both lists. Specifically the number 70 is in both lists.
Mathematically:
100 / 70 = 1 3/7 --> round down to 1.
Subtract that number that was double-counted.
10 + 14 - 1 = 23 numbers
Answer:
23 numbers are divisible by 10 or 7 in that range.
Specifically:
{7, 10, 14, 20, 21, 28, 30, 35, 40, 42, 49, 50, 56, 60, 63, 70, 77, 80, 84, 90, 91, 98, 100}