当前位置:网站首页>js例题打印1-100之间所有7的倍数的个数及总和
js例题打印1-100之间所有7的倍数的个数及总和
2022-06-27 07:20:00 【I am the sun?】
代码:
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>打印1-100之间所有7的倍数的个数及总和</title>
<script type="text/javascript">
var sum = 0,count = 0;
for(var i = 1;i <= 100;i++){
if(i % 7 == 0){
console.log(i);
sum+=i;
count+=1;
}
}
console.log("7的倍数的个数:" + count);
console.log("7的倍数的总和:" + sum);
</script>
</head>
<body>
</body>
</html>
运行结果:
边栏推荐
- Memory barrier store buffer, invalid queue
- 语音信号处理-概念(二):幅度谱(短时傅里叶变换谱/STFT spectrum)、梅尔谱(Mel spectrum)【语音的深度学习主要用幅度谱、梅尔谱】【用librosa或torchaudio提取】
- How torch. gather works
- 剑指 Offer 07. 重建二叉树
- 【编译原理】山东大学编译原理复习提纲
- How to write controller layer code gracefully?
- 云服务器配置ftp、企业官网、数据库等方法
- 磁选机是什么?
- Win10 remote connection to ECS
- How to implement redis cache of highly paid programmers & interview questions series 116? How do I find a hot key? What are the possible problems with caching?
猜你喜欢

POI replacing text and pictures in docx

Configuring FTP, enterprise official website, database and other methods for ECS

语音信号处理-概念(二):幅度谱(短时傅里叶变换谱/STFT spectrum)、梅尔谱(Mel spectrum)【语音的深度学习主要用幅度谱、梅尔谱】【用librosa或torchaudio提取】

Unsafe中的park和unpark

One person manages 1000 servers? This automatic operation and maintenance tool must be mastered

IDEA连接数据库报错

Stream常用操作以及原理探索

Oppo interview sorting, real eight part essay, abusing the interviewer

win10远程连接云服务器

Rust Async: smol源码分析-Executor篇
随机推荐
The song of cactus -- throwing stones to ask the way (1)
Bean拷贝详解
Jupiter notebook file directory
Speech signal processing - concept (4): Fourier transform, short-time Fourier transform, wavelet transform
大学数据库mysql
Custom palette for ggplot2
Xiaomi Interviewer: let's talk about the proficient Registration Center for three days and three nights
语音信号处理-概念(一):时谱图(横轴:时间;纵轴:幅值)、频谱图(横轴:频率;纵轴:幅值)--傅里叶变换-->时频谱图【横轴:时间;纵轴:频率;颜色深浅:幅值】
Memory barrier store buffer, invalid queue
Nature、science、cell旗下刊物
jupyter notebook文件目录
如何优雅的写 Controller 层代码?
Speech signal feature extraction process: input speech signal - framing, pre emphasis, windowing, fft- > STFT spectrum (including amplitude and phase) - square the complex number - > amplitude spectru
js中判断奇偶的函数,求圆面积的函数
Gérer 1000 serveurs par personne? Cet outil d'automatisation o & M doit être maîtrisé
【软件工程】山东大学软件工程复习提纲
数据库系统工程师对口专业有哪些?
JDBC事务提交事例
JDBC operation MySQL example
win10远程连接云服务器