当前位置:网站首页>JS output shape
JS output shape
2022-06-27 07:35:00 【I am the sun?】
js Output 5*5 Star rectangle for
<!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>Document</title>
<script type="text/javascript">
for(var i = 1;i <= 5;i++){
for(var j = 1;j <= 5;j++){
document.write("*");
}
document.write("<br />");
}
</script>
</head>
<body>
</body>
</html>
Running results :
js Output right triangle
<!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>Document</title>
<script type="text/javascript">
// for(var i = 1;i <= 5;i++){
// for(var j = 1;j <= 5;j++){
// document.write("*");
// }
// document.write("<br />");
// }
for(var i = 1;i <= 5;i++){
for(var j = 1;j <= i;j++){
document.write("*");
}
document.write("<br />");
}
</script>
</head>
<body>
</body>
</html>
Running results :
js Output inverted right triangle
<!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>Document</title>
<script type="text/javascript">
// Type 1 : rectangular
/*
for(var i = 1;i <= 5;i++){
for(var j = 1;j <= 5;j++){
document.write("*");
}
document.write("<br />");
}
*/
// Type 2 : Right triangle
/*
for(var i = 1;i <= 5;i++){
for(var j = 1;j <= i;j++){
document.write("*");
}
document.write("<br />");
}
*/
// Type 3 : An inverted right triangle
for(var i = 1;i <= 5;i++){
for(var j = 5;j >= i;j--){
document.write("*");
}
document.write("<br />");
}
</script>
</head>
<body>
</body>
</html>
Running results :
边栏推荐
- 1-4 decimal representation and conversion
- Visual studio vs shortcut key usage
- 语音信号处理-概念(二):幅度谱(短时傅里叶变换谱/STFT spectrum)、梅尔谱(Mel spectrum)【语音的深度学习主要用幅度谱、梅尔谱】【用librosa或torchaudio提取】
- Goodbye, agile Scrum
- yarn create vite 报错 ‘D:\Program‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件
- Window right click management
- js打印99乘法表
- 多表联查--07--- Hash join
- Interviewer: do you have any plan to request a lot of data that does not exist in redis to destroy the database?
- Construction of defense system for attack and defense exercises part II common strategies for responding to attacks
猜你喜欢
Oppo interview sorting, real eight part essay, abusing the interviewer
js中输入三个值,并且由小到大输出
js打印99乘法表
Interviewer: do you have any plan to request a lot of data that does not exist in redis to destroy the database?
log4j:WARN No such property [zipPermission] in org.apache.log4j.RollingFileAppender.
Error in idea connection database
mssql如何使用语句导出并删除多表数据
2、项目使用的QT组件
再见了,敏捷Scrum
语音信号处理-概念(二):幅度谱(短时傅里叶变换谱/STFT spectrum)、梅尔谱(Mel spectrum)【语音的深度学习主要用幅度谱、梅尔谱】【用librosa或torchaudio提取】
随机推荐
Apifox learning
语音合成:Tacotron详解【端到端语音合成模型】【与传统语音合成相比,它没有复杂的语音学和声学特征模块,而是仅用<文本序列,语音声谱>配对数据集对神经网络进行训练,因此简化了很多流程】
Vs how to configure opencv? 2022vs configuration opencv details (multiple pictures)
The first part of the construction of the defense system of attack and defense exercise is the introduction and the four stages of Defense
Origin of forward slash and backslash
[graduation season] graduation is the new beginning of your life journey. Are you ready
请问如何在网页通过excel文件的形式向后段数据库添加数据
R 语言并行计算 spearman 相关系数,加快共现网络(co- occurrence network)构建速度
js打印99乘法表
js中输入三个值,并且由小到大输出
剑指 Offer 07. 重建二叉树
RNA SEQ data analysis in R - investigate differentially expressed genes in the data!
mssql如何使用语句导出并删除多表数据
VNC Viewer方式的远程连接树莓派
js用switch输出成绩是否合格
js用while循环计算假如投资多年的利率为5%,试求从1000块增长到5000块,需要花费多少年
JDBC transaction commit case
log4j:WARN No such property [zipPermission] in org. apache. log4j. RollingFileAppender.
Stream常用操作以及原理探索
Sword finger offer 07 Rebuild binary tree