SHARE
TWEET

Untitled

a guest May 24th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int v[100],n;
  7. cin>>n;
  8. for(int i=0;i<n;i++)
  9. cin>>v[i];
  10. for(int i=0;i<n;i++)
  11. if(v[i]%2==0)
  12. {
  13. n++;
  14. for(int j=n;i>0;j--)
  15. v[j]=v[j-1];
  16. v[i+1]=v[i]*2;
  17. }
  18. for(int i=0;i<n;i++)
  19. cout<<v[i]<<" ";
  20. return 0;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top