Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
154524 万骏博 比较三个数的大小 C++ Accepted 1 MS 272 KB 447 2026-05-30 14:57:23

Tests(1/1):


Code:

#include <bits/stdc++.h> using namespace std; void swap(int* p1, int* p2) { int temp = *p1; *p1 = *p2; *p2 = temp; } void sortDescending(int* a, int* b, int* c) { if (*a < *b) swap(a, b); if (*a < *c) swap(a, c); if (*b < *c) swap(b, c); } int main() { int a, b, c; cin >> a >> b >> c; sortDescending(&a, &b, &c); cout << a << " " << b << " " << c << endl; return 0; }