Omonov Sardorbek Deque
Download 81.32 Kb.
|
10-tajriba ishi MTA
941-21 Omonov Sardorbek Deque 1) Dekdagi manfiy sonlarni o„chiring. Dastur kodi: #include #include using namespace std; void showdq(deque deque for (it = g.begin(); it != g.end(); ++it) cout<<*it<<" "; cout< int main() { deque int n, x; cin>>n; for(int i=1; i<=n/2; i++){ cin>>x; gquiz.push_back(x); cin>>x; gquiz.push_front(x); } deque deque for(it = gquiz.begin(); it != gquiz.end(); ++it){ if(*it>=0) positive.push_back(*it); } cout << "The deque gquiz is : "; showdq(gquiz); cout << "The deque positive is : "; showdq(positive); return 0; } 2)Berilgan so’zning unli harflarini dekning chap tomonidan, undoshlarini o’ng tomondan kiriting. #include #include using namespace std; void showdq(deque deque for (it = g.begin(); it != g.end(); ++it) cout<<*it<<" "; cout< int main(){ string s; cin>>s; deque for(int i=0; i if(y==65 || y==69 || y==73 || y==79 || y==85 || y==97 || y==101 || y==105 || y==111 || y==117) gquiz.push_back(s[i]); else gquiz.push_front(s[i]); } cout << "The deque gquiz is : "; showdq(gquiz); return 0; } Download 81.32 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling