Complete the findDigits function below.
| 4 | |
| 5 | // Complete the findDigits function below. |
| 6 | int findDigits(int n) { |
| 7 | //initialize an int to determine divisor |
| 8 | int r =n; |
| 9 | int count=0; |
| 10 | |
| 11 | while(r>0){ |
| 12 | // make a formula to get the target result |
| 13 | if(r % 10 != 0 && n % (r % 10) == 0) { |
| 14 | //count the unique numbers |
| 15 | count++; |
| 16 | } |
| 17 | r = r / 10; |
| 18 | } |
| 19 | return count; |
| 20 | } |
| 21 | |
| 22 | int main() |
| 23 | { |