当前位置: > 用java编写一个程序,计算1!+2!+3!+4!+5!...
题目
用java编写一个程序,计算1!+2!+3!+4!+5!

提问时间:2021-01-19

答案
public class TestArray{public static void main(String[] args){int m = 0;for(int i = 1;i < 6;i++){int n = 1;for(int j = 1;j < i+1;j++){n = n * j;}m = m + n;}System.out.println(m);}}运行结果:153
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.