当前位置:网站首页>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++;}}
边栏推荐
猜你喜欢
进程和线程
华为云云数据库RDS MySQL 版初试探【华为云至简致远】
KD-SCFNet: More Accurate and Efficient Salient Object Detection Through Knowledge Distillation (ECCV2022)
Harvard University smashes the field: DALL-E 2 is just a "glue monster", and the generation accuracy rate is only 22%
Shell Three Musketeers-----sed command
创建二维数组
浅谈 Redis 的底层数据结构
QWebAssembly中文适配
2022-08-07 第五小组 顾祥全 学习笔记 day31-集合-Map集合
年初离职,学习半年源码,终于拿到了蚂蚁Offer,分享面试过程
随机推荐
今日睡眠质量记录83分
【小码匠自习室】让错误成为孩子进步的阶梯
synchronized修饰类的注意事项
KD-SCFNet: More Accurate and Efficient Salient Object Detection Through Knowledge Distillation (ECCV2022)
"Small yards artisan study room" friends of friends is not a friend
PC端实用软件推荐
基于接口而非实现编程
浅谈 Redis 的底层数据结构
在中国银河证券开户安全吗 齐齐哈尔股票开户
poj3744 Scout YYF I
sample function—R language
QWebAssembly中文适配
电商秒杀系统架构设计
面试官:Redis 大 key 要如何处理?
星起航跨境—当前形势下,突破思维做精细化运营才能提高转化
【Kaggle】Save My Paper 基于自编码器的文本图像去噪
手把手教你设计一个全局异常处理器
如何成为团队核心?从写出不可维护的代码开始
shell regular expression, Three Musketeers grep command
初窥门径代码起手,Go lang1.18入门精炼教程,由白丁入鸿儒,首次运行golang程序EP01