惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Know Your Adversary
Know Your Adversary
云风的 BLOG
云风的 BLOG
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
B
Blog
罗磊的独立博客
宝玉的分享
宝玉的分享
Vercel News
Vercel News
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
T
Threatpost
Security Latest
Security Latest
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
I
Intezer
P
Privacy International News Feed
D
Docker
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
M
MIT News - Artificial intelligence
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
Lohrmann on Cybersecurity
Google DeepMind News
Google DeepMind News
The Last Watchdog
The Last Watchdog
A
Arctic Wolf
IT之家
IT之家
S
SegmentFault 最新的问题
S
Securelist
博客园 - 叶小钗
N
News and Events Feed by Topic
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
Hacker News: Ask HN
Hacker News: Ask HN
博客园 - Franky
GbyAI
GbyAI
AI
AI
Y
Y Combinator Blog
WordPress大学
WordPress大学
Latest news
Latest news
Microsoft Security Blog
Microsoft Security Blog
人人都是产品经理
人人都是产品经理
N
News | PayPal Newsroom
The Cloudflare Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
I
InfoQ

博客园 - 网络隐士

[游戏] 连连看之eBay易趣搞笑版 [.NET之西天取经] (01) 即将踏上去硅谷的班机 张江大厦蒸包子,东湖物业真抠门 淘宝的人工封IP技术真好玩 感叹吴总落户易趣 美国签证二进宫 隐士搞定美国签证惊魂记 eBay之歌(Flash版) Python代码高亮显示工具 将GBK汉字转化为拼音的Python小程序 一个小巧的MySQL Shell 一个小巧的Python Shell 根据CDImage.cue产生自动改名命令的Python小程序 繁体中文转换为简体中文的PHP类 简体中文转换为繁体中文的PHP类 GBK汉字转化为拼音或笔画的PHP类 文本间加入任意字符的PHP函数 显示code39条形码的PHP类 JavaScript日历
阶乘运算之Python VS Java
网络隐士 · 2005-09-13 · via 博客园 - 网络隐士

阶乘运算,随便写一个1000!,结论大家自己去总结吧!

================Python版================
print reduce(lambda x,y:x*y, range(1, 1001))

================Java版================
import java.io.*;
import java.math.*;
public class Main
{
    public static BigDecimal fact(int num)
    {
        BigDecimal sum = new BigDecimal(1.0);
        int i;
        BigDecimal a;
        for(i = 1; i <= num; i++)
        {
            a = new BigDecimal(i);
            sum =sum.multiply(a);
        }
        return sum;
    }
    public static void main(String args[])
    {
       System.out.println(fact(1000));
    }
}