当前位置:网站首页>JS-Bom-while (calculate leap year)
JS-Bom-while (calculate leap year)
2022-08-08 14:31:00 【(-^_^-)】
Calculate if it is a leap year:
Partial hundred years: Leap years that are divisible by 4.
A full hundred years: Leap years are divisible by 400.
function hanshu(){var n1 =document.getElementById('1');var n2 =document.getElementById('2');var n=0;year=parseInt(n1.value);while(n<10){//Calculate 10 timesif((year%4==0&&year%400!=0)||year%400==0){//Not a whole hundred years: Leap years that are divisible by 4.//Full hundred years: Leap years that are divisible by 400.n++;n2.innerHTML+=year+",";}year++;}}
边栏推荐
- HackTheBox | Previse
- flink知识
- Review: What is the pre-approval of autumn recruitment?What is an ordinary autumn move?It's all recruitment, why do you need to set these two recruitment time periods?
- 2022年8月7日 暑假第四周总结
- mysql 查询一个字段为特定值,并且另一个字段的值出现两次的记录?
- OrderedDict构建函数模块的不常见写法
- 小白大白读论文-关于EfficientNetV2论文的 疑问 与 总结
- 电商秒杀系统架构设计
- sample function—R language
- a += 1 += 1为什么是错的?
猜你喜欢
[Redis] Bitmap and usage scenarios of bitmap (statistics of online people and user online status)
IT故障快速解决就用行云管家!快速安全!
【干货】交换机的接口类型完全实物了解
shell三剑客-----sed命令
sample function—R language
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
剑指 Offer 66. 构建乘积数组
基于Nodejs的医生预约平台的设计和实现
keil5——安装教程附资源包
更改默认打开应用程序设置
随机推荐
【低代码】1405- 浅谈低代码平台远程组件加载方案
【Kaggle实践记录】电商图片分类
30K成功入职京东:拿到京东offer经验分享「面试经历+面试真题」
基于Nodejs的医生预约平台的设计和实现
兔起鹘落全端涵盖,Go lang1.18入门精炼教程,由白丁入鸿儒,全平台(Sublime 4)Go lang开发环境搭建EP00
【干货】交换机的接口类型完全实物了解
现在网上开户安全么?接着证券开户选择哪个证券?
IT故障快速解决就用行云管家!快速安全!
"Small yards artisan study room" friends of friends is not a friend
【小码匠自习室】让错误成为孩子进步的阶梯
UOJ#748-[UNR #6]机器人表演【dp】
【LeetCode】761. Special binary sequence
poj3744 Scout YYF I
浏览器跨域方案,适用于本地调试接口(超简单)
基于接口而非实现编程
无头单向非循环链表(C语言实现)
JS加法器(DOM)
Brief description of the state of the thread
【小码匠自习室】叛逆的小孩,打死也不改
LeetCode Daily Question 2022/8/1-2022/8/7