MInhTrietdevtriet.hashnode.devยทAug 9, 2023Count divisor of a numberI have the following problem: How many divisors does a given number n have? For example: n = 6 so the answer is 4 because we have 1, 2, 3, 6. Naive method You can loop through 1 to n, and count the divisors. void countDivisors(int n) { int cnt = ...C++Add a thoughtful commentNo comments yetBe the first to start the conversation.