fork(1) download
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int n, cases = 1, a[3];
  7. cin >> n;
  8. while (cases != n + 1) {
  9. cin >> a[0] >> a[1] >> a[2];
  10. sort(a, a + 3);
  11. cout << "Sorted array: " << a[0] << " " << a[1] << " " << a[2] << endl;
  12. cout << "Case " << cases << ": " << a[1] << endl;
  13. cases++;
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 3420KB
stdin
1
30 25  15
stdout
Sorted array: 15 25 30
Case 1: 25