9-tajriba ishi Omonov Sardorbek
Download 0.93 Mb.
|
1 4931781594466747091
9-tajriba ishi Omonov Sardorbek Har bir talaba 4 tadan misol ishlashi kerak! Navbat o„rtasiga '+' belgi joylashtirilsin. Navbat eng kichik elementi topilsin va undan keyin 0 joylashtirilsin. Navbat eng katta elementi topilsin va undan keyin 0 joylashtirilsin. Navbat eng kichik elementi o„chirilsin. 1) #include #include using namespace std; void showq(queue queue int h=g.size(); while (!g.empty()) { if(h==gq.size()/2) cout<<"+ "; h--; cout< } } int main() { queue int n, x; cin>>n; for(int i=0; i gquiz.push(x); } showq(gquiz); return 0; } 2) #include #include using namespace std; void showq(queue queue while (!g.empty()) { cout< } cout< int main() { queue int n, x; cin>>n; int y, in, kich=1000; for(int i=0; i if(x } queue for(int i=1; i<=n+1; i++){ if(i==in+1) {help.push(0);} else { help.push(gquiz.front()); gquiz.pop(); } } showq(help); return 0; } 3)
#include using namespace std; void showq(queue queue while (!g.empty()) { cout< } cout< int main() { queue int n, x; cin>>n; int y, in, kich=-1000; for(int i=0; i if(x>kich) {kich=x;in=i+1;} gquiz.push(x); } queue for(int i=1; i<=n+1; i++){ if(i==in+1) {help.push(0);} else { help.push(gquiz.front()); gquiz.pop(); } } showq(help); return 0; } 4) #include #include using namespace std; void showq(queue queue while (!g.empty()) { cout< } cout< int main() { queue int n, x; cin>>n; int y, in, kich=1000; for(int i=0; i if(x } queue for(int i=1; i<=n; i++){ if(i==in) { gquiz.pop();} else { help.push(gquiz.front()); gquiz.pop(); } } showq(help); return 0; } Download 0.93 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling