Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int v[201];
- int main ()
- {
- int n,l=0,i,j,aux;
- cin>>n;
- while(n>=0)
- {
- if(n%2==1)
- {
- v[++l]=n;
- }
- cin>>n;
- }
- for(i=1;i<=l;i++)
- for(j=1;j<=l;j++)
- if(v[i]>v[i])
- {
- aux=v[i];
- v[i]=v[j];
- v[j]=aux;
- }
- for(i=1;i<=l;i++)
- cout<<v[i]<<" ";
- }
Advertisement
Add Comment
Please, Sign In to add comment