0
点赞
收藏
分享

微信扫一扫

三个数排序的极简方法

胡桑_b06e 2022-11-22 阅读 87


三个数按大小排序

#include <iostream>
int main() {
int a, b, c;
std::cin >> a >> b >> c;
if (a < b) std::swap(a, b);
if (a < c) std::swap(a, c);
if (b < c) std::swap(b, c);

printf("%d %d %d", a, b, c);
return 0;
}


举报

相关推荐

0 条评论