Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sortare(int v[30],int n)
- {int i,j,aux,term;
- for(i=0;i<n;i++){
- j=i-1;
- term=0;
- aux=v[i];
- do{
- if(aux<v[j]){
- v[j+1]=v[j];
- j--;
- }
- else term=1;
- }while((j!=-1)&&(!term));
- v[j+1]=aux;}
- for(i=0;i<n;i++)
- printf("%d ",v[i]);}
Advertisement
Add Comment
Please, Sign In to add comment