Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. void Insert(int a[], int &n)
  2.  
  3. {
  4.  
  5.    int i,k=0;
  6.  
  7.    for (i=0; i<n; ++i)
  8.  
  9.        if (a[i]%2) ++k;;
  10.  
  11.    int j=n+k-1;
  12.  
  13.    for (i=n-1; i>=0; --i)
  14.  
  15.    {
  16.  
  17.        if (a[i]%2) a[j--]=2*a[i];
  18.  
  19.        a[j--]=a[i];
  20.  
  21.    }
  22.  
  23.    n=n+k;
  24.  
  25. }
  26.  
  27. Citește mai multe pe Brainly.ro - https://brainly.ro/tema/6032513#readmore
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement