fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int n, max, mid;
  5. max = 0;
  6. n = -1;
  7. while (n != 0) {
  8. cin >> n;
  9. if (max < n) {
  10. mid = max;
  11. max = n;
  12. }
  13. }
  14. cout << max << mid << n;
  15. }
Success #stdin #stdout 0s 15232KB
stdin
1
5
3
0
7
stdout
510