Ro’yxatdagi eng kichik elementini toping
Download 319.03 Kb.
|
Mirzaabbos
Muhammad Al-Xorazmiy Nomidagi Toshkent Axborot Texnalogiyalari Universiteti SWD 005-2 guruh talabasi Zaylobiddinov Mirzaabbosning Dasturlash II (amaliyot) fanidan tayyorlagan 2-amaliy ishi Variant 31.
C++ kodi: #include #include using namespace std; int main(){ list int n,a; cout<<"Nechta element kiritmoqchisiz: n=";cin>>n; for(int i=0;i mylist.push_back(a); } int min=mylist.front(); for(auto i=mylist.begin();i!=mylist.end();i++){ if(min>*i){ min=*i; } } cout<<"\nRo'yhatning eng kichik elementi: min="<
C++ kodi: #include #include using namespace std; int main(){ deque cout<<"Dastlabki ro'yhat:\n"; for(auto i=mydeque.begin();i!=mydeque.end();i++){ cout<<*i<<" "; } for(auto i=mydeque.begin();i!=mydeque.end();i++){ if(*i%2==0){ mydeque.erase(i,i+1); } } cout<<"\nO'zgartirilgan ro'yhat:\n"; for(auto i=mydeque.begin();i!=mydeque.end();i++){ cout<<*i<<" "; } } Download 319.03 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling