2 Star 0 Fork 0

CS-IMIS-23/zc20172324

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nfactorialwhileloop.java 590 Bytes
一键复制 编辑 原始数据 按行查看 历史
zc20172324 提交于 2018-04-11 11:41 +08:00 . 阶乘-while
import java.util.Scanner;
public class nfactorialwhileloop
{
public static void main(String[] args)
{
int number;
int factorial =1;
int n = 1;
Scanner scan = new Scanner(System.in);
System.out.print("Enter the number: ");
number = scan.nextInt();
while(n<number)
{
n++;
factorial*=n;
}
System.out.println("n! =" + factorial);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/CS-IMIS-23/zc20172324.git
git@gitee.com:CS-IMIS-23/zc20172324.git
CS-IMIS-23
zc20172324
zc20172324
master

搜索帮助