找出在范围内不可被任何数整除的数字,使用C++
在本文中,我们将讨论查找 1 到 n(给定)之间的数字的问题,这些数字不能被 2 到 10 之间的任何数字整除。让我们通过一些例子来理解这一点 -
Input : num = 14 Output : 3 Explanation: There are three numbers, 1, 11, and 13, which are not divisible. Input : num = 21 Output : 5 Explanation: There are five numbers 1, 11, 13, 17, and 19, which are not divisible.登录后复制