class Solution
{
public:
vector<int> selfDividingNumbers(int left, int right)
{
vector<int>res;
for(int j=left;j<=right;j++)
{
if(judgesdnum(j))
res.push_back(j);
}
return res;
} bool judgesdnum(int i)
{
int num=i;
while(num>)
{
int cur=num%;
if(cur==||i%cur!=)
return false;
num/=;
}
return true;
}
};

写个判定函数,一个一个判定,问题不大

728. Self Dividing Numbers的更多相关文章

  1. 【Leetcode_easy】728. Self Dividing Numbers

    problem 728. Self Dividing Numbers solution1: 使用string类型来表示每位上的数字: class Solution { public: vector&l ...

  2. LeetCode - 728. Self Dividing Numbers

    A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is ...

  3. LeetCode 728 Self Dividing Numbers 解题报告

    题目要求 A self-dividing number is a number that is divisible by every digit it contains. For example, 1 ...

  4. [LeetCode&Python] Problem 728. Self Dividing Numbers

    A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is ...

  5. 728. Self Dividing Numbers可以自己除以自己的数字

    [抄题]: A self-dividing number is a number that is divisible by every digit it contains. For example, ...

  6. 【LeetCode】728. Self Dividing Numbers 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 循环 filter函数 数字迭代 日期 题目地址:h ...

  7. Python 解leetcode:728. Self Dividing Numbers

    思路:循环最小值到最大值,对于每一个值,判断每一位是否能被该值整除即可,思路比较简单. class Solution(object): def selfDividingNumbers(self, le ...

  8. [LeetCode] Self Dividing Numbers 自整除数字

    A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is ...

  9. LeetCode算法题-Self Dividing Numbers(Java实现)

    这是悦乐书的第305次更新,第324篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第173题(顺位题号是728).自分割数是一个可被其包含的每个数字整除的数字.例如,12 ...

随机推荐

  1. anaconda的安装tensorflow

    在anaconda prompt中我们输入 anaconda search -t conda tensorflow 查看能在哪里安装tensorflow anaconda show dhirschfe ...

  2. windows phpstudy如何扩展MongoDB

    phpstudy如何扩展MongoDB 作者: default|标签:phpstudy MongoDB PHP|2017-9-9 10:17 phpstudy扩展MongoDB 前置工作安装PHPst ...

  3. Python词云(词频统计,掩膜显示)

    Python2.7 anaconda.安装Wordcloud,网上有许多下载路径,说一下掩模,就是在这个膜的区域才会有东西,当然这个与实际的掩模还有一定区别,这个词频显示是把所有统计的词,显示在这个掩 ...

  4. GridView中CheckBox翻页记住选项

    <asp:GridView ID="gvYwAssign" runat="server" AutoGenerateColumns="False& ...

  5. swift 带有下划线的UIbutton

    import UIKit /// 带下划线的Button class UnderlineButton: JYBaseButton { /// 下划线高度 var underLineHeight:CGF ...

  6. 操作符offset

    操作符offset在汇编语言中是由编译器处理的符号,它的功能是取得标号的偏移地址. assume cs:codesg codesg segment start: mov ax, offset star ...

  7. Linux下more命令C语言实现实践 (Unix-Linux编程实践教程)

    1. more第一版 实现基础功能,显示每一页固定24行文本,“q Enter”退出, “Enter” 下一行, “space Enter”下一页. #include<stdio.h> # ...

  8. C#设计模式-2工厂方法模式(Factory Method)

    什么是工厂模式?类比生活中的概念,当我们需要打电话的时候,我们需要一部手机,我们通常会选择直接去卖手机的实体店买.但在程序设计中,当我们需要调用一个类(PhoneA或PhoneB)的方法的时候,我们往 ...

  9. Java中的forin语句

    forin的原理 forin语句是JDK5版本的新特性,在此之前,遍历数组或集合的方法有两种:通过下标遍历和通过迭代器遍历.先举个例子: @Test public void demo() { Stri ...

  10. snort帮助文档

    [1] CentOS6.6下基于snort+barnyard2+base的入侵检测系统的搭建 2 基于Snort的C_S模式的IDS的设计与应用_王会霞.caj [3] Snort 笔记1 - 3种模 ...