while (*rr > z) rr--;
if (ll <= rr) {
swap(*ll, *rr); ll++; rr--;}}
if (l < rr) quicksort(l, rr + 1);
if (ll < r) quicksort(ll, r); }
3)
#include
#include
#include
#include
using namespace std;
void Navbat_In(deque<char> &D, int n){
int j=1;
for(char i='A'; i<='w'; i++){
D.push_back(i);
if(j==n)break;
j++;
}
}
void Navbat_Out(deque<char> &D){
for(int i=0; i cout<}
}
void insert_belgi_middle_element(deque<char> &D){
deque<char>::iterator it = D.begin();
for(int i=0; iit = D.begin()+i;
if(i==D.size()/2){
D.insert(it,'+'); i=D.size();
}
}
}
int main(){
deque<char> Navbat;
int n; cout<<"Navbat elementlari sonini kiriting: "; cin>>n;
Navbat_In(Navbat, n);
Navbat_Out(Navbat);
insert_belgi_middle_element(Navbat);
cout< Navbat_Out(Navbat);
}
Do'stlaringiz bilan baham: |