Advertisement
Andrey_ZoZ

88процентов

Sep 4th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. int main()
  4. {
  5.     int count;
  6.     std::cin>>count;
  7.     count=abs(count);
  8.     int* massive=new int[count];
  9.     for (int index{0}; index<count; ++index) {
  10.         std::cin>>massive[index];
  11.         if(massive[index]>0){massive[index]+=2;}
  12.     }
  13.     for (int index{0}; index<count; ++index) {
  14.         std::cout<<massive[index]<<" ";
  15.     }
  16.    
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement