problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
leetcode::self_dividing_numbers::Solution类 参考

#include <leetcode.h>

静态 Public 成员函数

static vector< int > selfDividingNumbers (int left, int right)
 

详细描述

在文件 leetcode.h1991 行定义.

成员函数说明

◆ selfDividingNumbers()

vector< int > leetcode::self_dividing_numbers::Solution::selfDividingNumbers ( int  left,
int  right 
)
static

在文件 leetcode.cpp5311 行定义.

5311 {
5312 vector<int> ans;
5313 for(int i = left; i <= right; ++i) {
5314 stringstream ss;
5315 ss << i;
5316 char ch;
5317 bool flag = true;
5318 while(ss >> ch) {
5319 const int num = ch - '0';
5320 if(num == 0) {
5321 flag = false;
5322 break;
5323 }
5324 if(i % num != 0) {
5325 flag = false;
5326 break;
5327 }
5328 }
5329 if(flag) {
5330 ans.push_back(i);
5331 }
5332 }
5333 return ans;
5334 }

引用了 acwing::acwing1929::left , 以及 acwing::acwing1929::right.

被这些函数引用 leetcode::self_dividing_numbers::TEST().


该类的文档由以下文件生成: