5- Tajriba Berilgan sonlar ketma-ketligida barcha elementlari shu sonlarni eng kichik elementiga bo’lib chiqilsin. Stack #include #include using namespace std;
int main(){
stack ST ;
int n,m;
cout <<"n="; cin >> n;
for(int i=0; icin >>m;
ST.push(m);}
stack ST1=ST;
double min;
min = ST.top();
for (int i=0 ; iif (min>ST.top()){
min = ST.top();}
ST.pop();}
cout << min ; cout << endl ;
for (int i=0 ; icout << ST1.top()/min <<" " ;
ST1.pop();}
return 0;}
Queue #include #include #include using namespace std;
int main(){
queue ST;
int n, m;
cout << " n = "; cin >> n;
for(int i=0; icin >> m;
ST.push(m);}
queueST1=ST;
double min;
min = ST.front();
for(int i=0; iif(min>ST.front()){
min = ST.front();}
ST.pop();}
cout << min; cout << endl;
for(int i=0; icout << ST1.front()/min << " ";
ST1.pop();}
return 0;}
priority_queue #include #include using namespace std;
int main(){
priority_queue ST ;
int n,m;
cout <<"n="; cin >> n;
for(int i=0; icin >>m;
ST.push(m);}
priority_queue ST1=ST;
double min;
min = ST.top();
for (int i=0 ; iif (min>ST.top()){
min = ST.top();}
ST.pop();}
cout << min ;
cout << endl ;
for (int i=0 ; icout << ST1.top()/min <<" " ;
ST1.pop();}
return 0;}