当前位置:网站首页>JS-BOM-阶乘计算
JS-BOM-阶乘计算
2022-08-08 14:24:00 【(-^_^-)】
使用for函数

function hanshu(){
var n1 =document.getElementById('1');
var n2 =document.getElementById('2');
n=n1.value; //数字是文本框中输入的内容
result=1;
for(i=1;i<=n;i++){
result=result*i;
}
n2.value=result;
}边栏推荐
- 医学图像数据增强-归一化
- Notes on synchronized modified classes
- KMP Media Group South Africa implemented a DMS (Document Management System) to digitize the process, employees can again focus on their actual tasks, providing efficiency
- 【Kaggle】Save My Paper 基于自编码器的文本图像去噪
- token系统讲解及过期处理
- 基于ModelArts的StyleGAN3生成高清图丨【华为云至简致远】
- 【Personal Summary】2022.8.7 Week End
- 俄驻美大使馆:扎波罗热核电站遭炮击威胁欧洲核安全
- 什么样的程序员在35岁依然被公司抢着要?打破程序员“中年危机”
- 专访|360高瀚昭:ISC十年,360数字安全大脑能够“看见”什么?
猜你喜欢

超详细的最新版 2022.2 kali 安装步骤及拍摄快照的方法

Pretraining Weekly Issue 56: Long Text Understanding, Instant Question Answering, Mask Self-Supervision

【系统设计】S3 对象存储
Experience Sharing | Systematic Design and Development of Business Cache

OpenInfra Days China 2022 |StreamNative 翟佳、刘德志受邀分享

Fast DDS 共享内存测试例修改栈空间大小的方式-如改为30M

华为云弹性云服务器ECS使用【华为云至简致远】

Harvard University smashes the field: DALL-E 2 is just a "glue monster", and the generation accuracy rate is only 22%

进程和线程

浏览器跨域方案,适用于本地调试接口(超简单)
随机推荐
【小码匠自习室】 [NOI Online 2022 入门组] 王国比赛
基于ModelArts的StyleGAN3生成高清图丨【华为云至简致远】
QtWebassembly遇到的一些报错问题及解决方案
mysql 查询一个字段为特定值,并且另一个字段的值出现两次的记录?
WPF 常用布局方式
华为云会议初体验【华为云至简致远】
LeetCode简单题之统计星号
HackTheBox | Previse
【小码匠自习室】叛逆的小孩,打死也不改
【Kaggle】Save My Paper 基于自编码器的文本图像去噪
进程和线程
Code Casual Recording Notes_Dynamic Programming_322 Change Exchange
[Small Coder Study Room] [NOI Online 2020-2 Beginner Group] Finished: Abominable precision will make you burnt
【Rust—LeetCode题解】1.两数之和
synchronized修饰类的注意事项
2022-08-07 The fifth group Gu Xiangquan study notes day31-collection-Map collection
Notes on synchronized modified classes
See how three years of CRUD programmers solve database deadlocks
今日睡眠质量记录83分
OpenInfra Days China 2022 |StreamNative 翟佳、刘德志受邀分享