当前位置:网站首页>JS enter three integers a, B and C, and sort them from large to small (two methods)
JS enter three integers a, B and C, and sort them from large to small (two methods)
2022-06-25 12:38:00 【Fall in love with*】
var a = Number(prompt(" Please enter an integer "));
var b = Number(prompt(" Please enter an integer "));
var c = Number(prompt(" Please enter an integer "));
if (a > b && a > c) {
if (b > c) {
document.write(a + "," + b + "," + c);
} else {
document.write(a + "," + c + "," + b);
}
} else if (b > a && b > c) {
if (a > c) {
document.write(b + "," + a + "," + c);
} else {
document.write(b + "," + c + "," + a);
}
} else {
if (a > b)
document.write(c + "," + a + "," + b);
else {
document.write(c + "," + b + "," + a);
}
} var a = prompt(" Input a");
var b = prompt(" Input b");
var c = prompt(" Input c");
var max = parseInt(a);
if (b > a && b > c) {
max = parseInt(b);
}
if (c > a && c > b) {
max = parseInt(c);
}
var min = parseInt(a);
if (b < a && b < c) {
min = parseInt(b);
}
if (c < a && c < b) {
min = parseInt(c);
}
var middle = (parseInt(a) + parseInt(b) + parseInt(c)) - (parseInt(max) + parseInt(min));
document.write(max + "," + middle + "," + min);边栏推荐
- Zhangxiaobai's way of penetration (V) -- detailed explanation of upload vulnerability and parsing vulnerability
- ARM V7 协处理器
- Full nanny tutorial of Market Research Competition (experience sharing)
- New and old cluster migration of Minio data
- PHP takes the difference set of two arrays
- Huile optimization system -- sharing of secondary development source code of huile optimization app system
- Network | indicators and test methods to measure the quality of the network
- Mind mapping video
- Introduction to jiuhongtianxia system development function -- jiuhongtianxia app development source code sharing
- R language uses the multinom function of NNET package to build an unordered multi classification logistic regression model, and uses the summary function to obtain the summary statistical information
猜你喜欢

20. MVVM command binding of WPF

K8s, docker compose install MySQL 8.0.18

2022 meisai topic C idea sharing + translation

Laravel excel export

Upgrade opsenssh to 8.8p1
![最大数[抽象排序之抽象规则]](/img/47/f6bafacc95f487854a3e304325f3f0.png)
最大数[抽象排序之抽象规则]

为何数据库也云原生了?

What is Flink? What can Flink do?

Draw the satellite sky map according to the azimuth and elevation of the satellite (QT Implementation)

Go novice exploration road 1
随机推荐
(2) Pyqt5 tutorial -- > using qtdesigner to separate interface code
Renrenyue -- renrenyue system development source code sharing
MySQL common interview questions
最大数[抽象排序之抽象规则]
Laravel excel export
R language uses the multinom function of NNET package to build an unordered multi classification logistic regression model, and uses the lrtest function of epidisplay package to perform multiple model
Figure explanation of fiborache sequence
Uncover gaussdb (for redis): comprehensive comparison of CODIS
Why do we do autocorrelation analysis? Explain application scenarios and specific operations
What is the primordial universe
Zhangxiaobai's road to penetration (7) -sql injection detailed operation steps -union joint query injection
sudo: ulimit: command not found
Total number of MySQL statistics, used and unused
Image tagging to obtain the coordinates of the image in the ImageView
Service charge and time setting code sharing involved in crmeb withdrawal process
GPS receiver design (1)
PHP appends the same elements to a two-dimensional array
ARM V7 ldr str 内存访问
Tidb common commands
Yunfan mall -- Yunfan mall system development source code sharing