fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. vector<int> x;
  9. int a;
  10. while (cin >> a)
  11. x.push_back(a);
  12. if (x.at(0) >= 0)
  13. {
  14. int min = *min_element(x.begin(), x.end());
  15. for (int &i : x)
  16. i *= min * min;
  17. }
  18. else
  19. {
  20. int max = *max_element(x.begin(), x.end());
  21. for (int &i : x)
  22. i *= max * max;
  23. }
  24. for (int i : x)
  25. cout << i << " ";
  26. return 0;
  27. }
Success #stdin #stdout 0s 3464KB
stdin
0 0 0 0 0
stdout
0 0 0 0 0