Untitled
raw download clone
TEXT
views 22
,
size 418 b
#include<iostream>
using namespace std;

int main()
{
    int n,i,k,j,x,v[101];
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>v[i];
    for(i=1;i<=n;i++)
        if(v[i]%2==0)
        {
            k=i;
            for(j=n;j>k;j--)
                v[j]=v[j-1];
            v[k]=0;
            n++;
            i++;
        }
    for(i=1;i<=n;i++)
        cout<<v[i]<<' ';

    return 0;

}
close fullscreen
Login or Register to edit or fork this paste. It's free.