博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Project Euler Problem 34 Digit factorials
阅读量:7060 次
发布时间:2019-06-28

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

Problem 34

145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.

Find the sum of all numbers which are equal to the sum of the factorial of their digits.

Note: as 1! = 1 and 2! = 2 are not sums they are not included.

C++:

#include 
using namespace std;const int MAX = 2540160;const int N = 10;long factorials[N] = {1, 1};int main(){ for(int i=2; i

转载于:https://www.cnblogs.com/tigerisland/p/7563996.html

你可能感兴趣的文章
MAVEN项目后 jar包无法发布到eclipse的web服务器
查看>>
选择结构与循环结构
查看>>
Linux系统生成随机密码的10种方法
查看>>
puppet初体验
查看>>
lnmp 编译安装
查看>>
Python tools for Penetration Tester
查看>>
freebsd 从普通用户切换到root下
查看>>
oracle安装前环境检查
查看>>
ansible出错
查看>>
linux内核中的信号机制--一个简单的例子
查看>>
【Java】File.createTempFile创建临时文件
查看>>
ldap bdb_db_open 错误解决办法
查看>>
根据菜单查找构建的窗体、流程、报表
查看>>
判断某年是否是闰年
查看>>
初探 C++ 标准库(二十六)
查看>>
安装SP3后不能进入系统的办法
查看>>
20150905日课程作业(计划任务mail,at,cron,)
查看>>
从源码读出不一样的Spring之Spring生态圈
查看>>
Table显示滚动条
查看>>
Java基础第三天_数组
查看>>