#include <iostream>
using namespace std;
int main() {
float a, b, c;
// Nhập vào 3 số
cout << "Nhập số thứ nhất: ";
cin >> a;
cout << "Nhập số thứ hai: ";
cin >> b;
cout << "Nhập số thứ ba: ";
cin >> c;
// Tìm số nhỏ nhất, trung bình và lớn nhất
float minVal, midVal, maxVal;
if (a <= b && a <= c) {
minVal = a;
if (b <= c) {
midVal = b;
maxVal = c;
} else {
midVal = c;
maxVal = b;
}
} else if (b <= a && b <= c) {
minVal = b;
if (a <= c) {
midVal = a;
maxVal = c;
} else {
midVal = c;
maxVal = a;
}
} else {
minVal = c;
if (a <= b) {
midVal = a;
maxVal = b;
} else {
midVal = b;
maxVal = a;
}
}
// In ra kết quả
cout << "Các số theo thứ tự tăng dần: " << minVal << ", " << midVal << ", " << maxVal << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBmbG9hdCBhLCBiLCBjOwoKICAgIC8vIE5o4bqtcCB2w6BvIDMgc+G7kQogICAgY291dCA8PCAiTmjhuq1wIHPhu5EgdGjhu6kgbmjhuqV0OiAiOwogICAgY2luID4+IGE7CiAgICBjb3V0IDw8ICJOaOG6rXAgc+G7kSB0aOG7qSBoYWk6ICI7CiAgICBjaW4gPj4gYjsKICAgIGNvdXQgPDwgIk5o4bqtcCBz4buRIHRo4bupIGJhOiAiOwogICAgY2luID4+IGM7CgogICAgLy8gVMOsbSBz4buRIG5o4buPIG5o4bqldCwgdHJ1bmcgYsOsbmggdsOgIGzhu5tuIG5o4bqldAogICAgZmxvYXQgbWluVmFsLCBtaWRWYWwsIG1heFZhbDsKCiAgICBpZiAoYSA8PSBiICYmIGEgPD0gYykgewogICAgICAgIG1pblZhbCA9IGE7CiAgICAgICAgaWYgKGIgPD0gYykgewogICAgICAgICAgICBtaWRWYWwgPSBiOwogICAgICAgICAgICBtYXhWYWwgPSBjOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIG1pZFZhbCA9IGM7CiAgICAgICAgICAgIG1heFZhbCA9IGI7CiAgICAgICAgfQogICAgfSBlbHNlIGlmIChiIDw9IGEgJiYgYiA8PSBjKSB7CiAgICAgICAgbWluVmFsID0gYjsKICAgICAgICBpZiAoYSA8PSBjKSB7CiAgICAgICAgICAgIG1pZFZhbCA9IGE7CiAgICAgICAgICAgIG1heFZhbCA9IGM7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgbWlkVmFsID0gYzsKICAgICAgICAgICAgbWF4VmFsID0gYTsKICAgICAgICB9CiAgICB9IGVsc2UgewogICAgICAgIG1pblZhbCA9IGM7CiAgICAgICAgaWYgKGEgPD0gYikgewogICAgICAgICAgICBtaWRWYWwgPSBhOwogICAgICAgICAgICBtYXhWYWwgPSBiOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIG1pZFZhbCA9IGI7CiAgICAgICAgICAgIG1heFZhbCA9IGE7CiAgICAgICAgfQogICAgfQoKICAgIC8vIEluIHJhIGvhur90IHF14bqjCiAgICBjb3V0IDw8ICJDw6FjIHPhu5EgdGhlbyB0aOG7qSB04buxIHTEg25nIGThuqduOiAiIDw8IG1pblZhbCA8PCAiLCAiIDw8IG1pZFZhbCA8PCAiLCAiIDw8IG1heFZhbCA8PCBlbmRsOwoKICAgIHJldHVybiAwOwp9