fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int k, x;
  6. cin >> k;
  7. for (int i = 0; i < k; i++) {
  8. cin >> x;
  9. cout << (x < 0? x: x + 2) << " ";
  10. }
  11. return 0;
  12. }
Success #stdin #stdout 0s 15232KB
stdin
4
1 3 -3 -12
stdout
3 5 -3 -12