博客
关于我
求出0~999999之间的所有“水仙花数”并输出。
阅读量:802 次
发布时间:2019-03-25

本文共 183 字,大约阅读时间需要 1 分钟。

0到999999之间的“水仙花数”(自恋数)是:

  • 153
  • 370
  • 371
  • 407
  • 这些数各自的数字立方和等于其本身,即153 = 1³ + 5³ + 3³,370 = 3³ + 7³ + 0³,371 = 3³ + 7³ + 1³,407 = 4³ + 0³ + 7³。通过编写程序检查每个数是否符合条件,确认这些是唯一满足条件的水仙花数。没有四位及以上的水仙花数。

    转载地址:http://tocyk.baihongyu.com/

    你可能感兴趣的文章
    PIGS POJ 1149 网络流
    查看>>
    PIL Image对图像进行点乘,加上常数(等像素操作)
    查看>>
    PIL Image转Pytorch Tensor
    查看>>
    PIL&QOOT;IOERROR:带有大图像的图像文件被截断(&Q)
    查看>>
    PIL.Image、cv2的img、bytes相互转换
    查看>>
    PIL.Image进行图像融合显示(Image.blend)
    查看>>
    pilicat-dfs 霹雳猫-分布式文件系统
    查看>>
    Pillow lacks the JPEG 2000 plugin
    查看>>
    SpringBoot之ElasticsearchRestTemplate常用示例
    查看>>
    ping 全网段CMD命令
    查看>>
    ping 命令的七种用法,看完瞬间成大神
    查看>>
    Pinia入门(快速上手)
    查看>>
    Pinia:$patch的使用场景
    查看>>
    Pinia:$subscribe()的使用场景
    查看>>
    Pinpoint对Kubernetes关键业务模块进行全链路监控
    查看>>
    Pinterest 大规模缓存集群的架构剖析
    查看>>
    pintos project (2) Project 1 Thread -Mission 1 Code
    查看>>
    PinYin4j库的使用
    查看>>
    PIP
    查看>>
    pip install goose-extractor // SyntaxError: Missing parentheses in call to 'print'
    查看>>