当前位置:网站首页>js中输入三个值,并且由小到大输出
js中输入三个值,并且由小到大输出
2022-06-27 07:20:00 【I am the sun?】
代码:
<!--有键盘输入三个整数分别是a,b,c;
对他们进行排序,并且从小到大输出-->
<!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">
var a,b,c;
// prompt的返回值是string类型,要转为number类型才好比较
a = +prompt("请输入第一个值: ");
b = +prompt("请输入第二个值: ");
c = +prompt("请输入第三个值: ");
if(a>b){
if(b>c){
alert("从小到大为:"+ c +" "+ b +" " + a);
}
else{
alert("从小到大为:"+ b +" "+ a +" "+ c);
}
}else{
if(b<c){
alert("从小到大为:" + a +" " + b + " " + c);
}else{
alert("从小到大为:"+ a + " " + c + " " + b);
}
}
</script>
</head>
<body>
</body>
</html>
运行结果:



边栏推荐
- Vs how to configure opencv? 2022vs configuration opencv details (multiple pictures)
- 大学数据库mysql
- hutool对称加密
- SQL考勤查询间隔一小时
- Custom palette for ggplot2
- 一个人管理1000台服务器?这款自动化运维工具一定要掌握
- 基础知识 | js基础
- Bean copy details
- Nature、science、cell旗下刊物
- (resolved) NPM suddenly reports an error cannot find module 'd:\program files\nodejs\node_ modules\npm\bin\npm-cli. js‘
猜你喜欢

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

OpenCV怎么下载?OpenCV下载后怎么配置?

Classical cryptosystem -- substitution and replacement

volatile 和 synchronized 到底啥区别?

内存屏障今生之Store Buffer, Invalid Queue
![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.

如何优雅的写 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

From 5 seconds to 1 second, the system flies

程序人生 - 程序员三十五岁瓶颈你怎么看?
随机推荐
[graduation season] graduation is the new beginning of your life journey. Are you ready
sql sever列名或所提供值的数目与表定义不匹配
数据库系统工程师对口专业有哪些?
R language calculates Spearman correlation coefficient in parallel to speed up the construction of co occurrence network
攻防演习防御体系构建之第一篇之介绍和防守的四个阶段
Window right click management
C# 请问怎么在更新数据库时候调用line与rows
Classical cryptosystem -- substitution and replacement
postgreSQL在windows系统遇到权限否认(permission denied)
Jupiter notebook file directory
【编译原理】山东大学编译原理复习提纲
2022 cisp-pte (II) SQL injection
apifox学习
pytorch Default process group is not initialized
Yarn create vite reports an error 'd:\program' which is neither an internal or external command nor a runnable program or batch file
mssql如何使用语句导出并删除多表数据
Origin of forward slash and backslash
攻防演习防御体系构建之第二篇之应对攻击的常用策略
(resolved) NPM suddenly reports an error cannot find module 'd:\program files\nodejs\node_ modules\npm\bin\npm-cli. js‘
DMU software syntax highlighting VIM setting -- Learning Notes 6