[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[原创代码] 欧拉计划016-What is the sum of the digits of the number 2^1000?

欧拉计划016-What is the sum of the digits of the number 2^1000?
  1. """
  2. python 欧拉计划016-What is the sum of the digits of the number 2^1000?
  3. https://projecteuler.net/problem=16
  4. 2016年4月14日 13:37:24 codegay
  5. """
  6. print(sum(map(int,list(str(2**1000)))))
  7. """
  8. 1366
  9. [Finished in 0.1s]
  10. """
复制代码
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

  1. #可以省掉list
  2. sum(map(int,str(2**1000)))
复制代码
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

projecteuler.net 网站,别人贴的julia一行流
  1. sum(digits(big(2)^1000))
复制代码
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

返回列表