当前位置:网站首页>js输出形状
js输出形状
2022-06-27 07:20:00 【I am the sun?】
js输出5*5的星星矩形
<!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>
运行结果:
js输出正直角三角形
<!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>
运行结果:
js输出倒直角三角形
<!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 />");
}
*/
//类型三:倒直角三角形
for(var i = 1;i <= 5;i++){
for(var j = 5;j >= i;j--){
document.write("*");
}
document.write("<br />");
}
</script>
</head>
<body>
</body>
</html>
运行结果:
边栏推荐
- boundvalueops和opsforvalue区别
- Idea method template
- Some settings about postfix completion code template in idea
- win10远程连接云服务器
- 剑指 Offer 07. 重建二叉树
- Interviewer: how to never migrate data and avoid hot issues by using sub database and sub table?
- Stream常用操作以及原理探索
- manim 数学引擎
- JDBC参数化查询示例
- Speech signal processing - concept (II): amplitude spectrum (STFT spectrum), Mel spectrum [the deep learning of speech mainly uses amplitude spectrum and Mel spectrum] [extracted with librosa or torch
猜你喜欢

一线大厂面试官问:你真的懂电商订单开发吗?

Multi table associated query -- 07 -- hash join

js中如何查看程序运行时间(计时器)

Interviewer: how to never migrate data and avoid hot issues by using sub database and sub table?

Yarn create vite reports an error 'd:\program' which is neither an internal or external command nor a runnable program or batch file

win10远程连接云服务器

How to download opencv? How to configure opencv after downloading?

面试官:请你介绍一下缓存穿透、缓存空值、缓存雪崩、缓存击穿的,通俗易懂

(已解决) MINet 进行测试时报错如下 raise NotImplementedError

Vs how to configure opencv? 2022vs configuration opencv details (multiple pictures)
随机推荐
JDBC operation MySQL example
The first part of the construction of the defense system of attack and defense exercise is the introduction and the four stages of Defense
(已解决) npm突然报错 Cannot find module ‘D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js‘
语音信号处理-概念(一):时谱图(横轴:时间;纵轴:幅值)、频谱图(横轴:频率;纵轴:幅值)--傅里叶变换-->时频谱图【横轴:时间;纵轴:频率;颜色深浅:幅值】
语音信号处理-概念(四):傅里叶变换、短时傅里叶变换、小波变换
volatile 和 synchronized 到底啥区别?
pytorch Default process group is not initialized
Get the query parameter in the address URL specify the parameter method
Manim math engine
Rust Async: smol源码分析-Executor篇
manim 数学引擎
File 与 MultipartFile概述
【软件工程】山东大学软件工程复习提纲
Sword finger offer 07 Rebuild binary tree
使用 Blackbox Exporter 测试网络连通性
hutool对称加密
Hutool symmetric encryption
【编译原理】山东大学编译原理复习提纲
log4j:WARN No such property [zipPermission] in org.apache.log4j.RollingFileAppender.
uview的安装和功能