1
0

2520.h 420 B

1234567891011121314151617181920212223242526
  1. //
  2. // Created by 李洋 on 2023/10/26.
  3. //
  4. #ifndef LEECODE_C_2520_H
  5. #define LEECODE_C_2520_H
  6. #include <string>
  7. using namespace std;
  8. class Q2520 {
  9. public:
  10. int countDigits(int num) {
  11. string str = to_string(num);
  12. int res = 0;
  13. for (auto &ch: str) {
  14. if (num % (ch - '0') == 0) {
  15. res++;
  16. }
  17. }
  18. return res;
  19. }
  20. };
  21. #endif //LEECODE_C_2520_H
备用站点 当前处于降级运行的备用站点,仅供应急访问,数据和功能可能不是最新。