当前位置:网站首页>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 :
边栏推荐
猜你喜欢

Interviewer: do you have any plan to request a lot of data that does not exist in redis to destroy the database?

What is a magnetic separator?

js中判断成绩是否合格,范围在0-100,否则重新输入

【Kevin三连弹之三】Rust真的比C慢吗?进一步分析queen微测评
![[graduation season] graduation is the new beginning of your life journey. Are you ready](/img/4e/aa763455da974d9576a31568fc6625.jpg)
[graduation season] graduation is the new beginning of your life journey. Are you ready
![log4j:WARN No such property [zipPermission] in org. apache. log4j. RollingFileAppender.](/img/2c/425993cef31dd4c786f9cc5ff081ef.png)
log4j:WARN No such property [zipPermission] in org. apache. log4j. RollingFileAppender.

Park and unpark in unsafe

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

再见了,敏捷Scrum

正斜杠反斜杠的由来
随机推荐
Interviewer: please introduce cache penetration, cache null value, cache avalanche and cache breakdown, which are easy to understand
Goodbye, agile Scrum
One person manages 1000 servers? This automatic operation and maintenance tool must be mastered
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?
uview的安装和功能
Cookie encryption 7 fidder analysis phase
guava 教程收集一些案例慢慢写 google工具类
多表联查--07--- Hash join
Multi table associated query -- 07 -- hash join
语音信号特征提取流程:输入语音信号-分帧、预加重、加窗、FFT->STFT谱(包括幅度、相位)-对复数取平方值->幅度谱-Mel滤波->梅尔谱-取对数->对数梅尔谱-DCT->FBank->MFCC
Remote connection raspberry pie in VNC Viewer Mode
Interviewer: how to never migrate data and avoid hot issues by using sub database and sub table?
JDBC parameterized query example
JDBC参数化查询示例
通过uview让tabbar根据权限显示相应数量的tabbar
JDBC读取Mysql数据列表
1-4 decimal representation and conversion
Interviewer: do you have any plan to request a lot of data that does not exist in redis to destroy the database?
JDBC操作Mysql示例
Gérer 1000 serveurs par personne? Cet outil d'automatisation o & M doit être maîtrisé