当前位置:网站首页>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 road to penetration (7) -sql injection detailed operation steps -union joint query injection
- Singleton mode in PHP to reduce memory consumption
- (2) Pyqt5 tutorial -- > using qtdesigner to separate interface code
- Arm V7 LDR STR memory access
- Go from 0 to 1. Obtain the installation package, get, post request, params, body and other parameters
- MySQL and excel tables importing database data (Excel for MySQL)
- R language dplyr package filter function filters the data rows in the specified list whose contents in the dataframe data are not (not equal to one of the specified vectors)
- Flutter common commands and problems
- ARM V7 连续加载/存储
- (3) Pyqt5 tutorial -- > signal and slot preliminary test
猜你喜欢

What is Flink? What can Flink do?

冷启动的最优解决方案

Penetration tool environment -- use of cknife Chinese kitchen knife

Happy shopkeeper source code -- Introduction to happy shopkeeper system development mode

Flutter common commands and problems

Zhangxiaobai's way of penetration (VIII) - detailed operation steps of SQL injection - Boolean blind injection of blind injection

K8s, docker compose install MySQL 8.0.18

The server reported an error 503 service unavailable:the system returned: (71) protocol error

laravel 9

(4) Pyqt5 tutorial -- > Custom signal and slot (super winding...)
随机推荐
Laravel excel export
ECSHOP whole site custom URL supports directory type
Wait for the end of the network request in the uniapp Onshow method before executing the subsequent code content
sudo: ulimit: command not found
为何数据库也云原生了?
PHP parsing QR code content
R language uses GLM function to build Poisson logarithmic linear regression model, processes three-dimensional contingency table data to build saturation model, and poisgof function of epidisplay pack
MySQL common interview questions
GPS receiver design (1)
R language dplyr package summary_ The at function calculates the count number, mean and median of multiple data columns (specified by vectors) in the dataframe data, and specifies na RM parameter, spe
What is the primordial universe
Renrenyue -- renrenyue system development source code sharing
Laravel is not logged in and cannot access the background by entering the URL
node. JS architecture optimization: reverse proxy and cache service
Zhengzheng e-commerce source code -- Zhengzheng advertising e-commerce system development source code sharing
Thinkphp3 use phpword to modify the template and download it
The network traceroute command is used to determine the path through which IP packets access the destination address.
Set the transparency of the picture to gradient from left to right
Install MySQL client
(3) Pyqt5 tutorial -- > signal and slot preliminary test