Ismoilova Shohidaning dasturlash 2 fanidan 3-topshiriq javobi. Tekshirdi: Xaydarova Marhamat
Download 1.17 Mb.
|
Al Xorazmiy nomidagi Toshkent Axborot texnologiyalari univarsitetining dasturiy injiniring fakulteti 1-kurs talabasi Ismoilova Shohidaning dasturlash 2 fanidan 3-topshiriq javobi. Tekshirdi: Xaydarova Marhamat. #include #include using namespace std; int main() { stack int n,min=0; cout<<"N = "; cin>>n; for(int i=0; i cin>>temp; if(i == 0 || temp < min) min = temp; st.push(temp); } while(!st.empty()) { if( (st.top() == min) ) nw.push(0); nw.push(st.top()); st.pop(); } while(!nw.empty()) { cout< } return 0; } #include #include #include #include #include using namespace std; #define EBB cout<<"==========================================================\n" class football { public: string ism, fam, sh; long long daromadi; double yoshi; }; class tens : public football { public: double lengtha; tens (string ism, string fam, string sh, long long daromadi, double yoshi, double lengtha){ this->ism=ism; this->fam=fam; this->sh=sh; this->daromadi=daromadi; this->yoshi=yoshi; this->lengtha=lengtha; } void getten() { cout< } }; bool lengths (tens &E, tens &B) { return (E.lengtha > B.lengtha); } int main () { int n; cout<<" Tenschilar necha kishi -> "; cin>>n; string is,f,s; long long d; double y,b; vector< tens > ebb; for (int i = 0; i < n; i++) { cout< "; cin>>is; cout< "; cin>>f; cout< "; cin>>s; cout< "; cin>>d; cout< "; cin>>y; cout< "; cin>>b; ebb.push_back( tens (is,f,s,d,y,b)); } EBB; sort(ebb.begin(), ebb.end(),lengths); vector for ( ee = ebb.begin(); ee != ebb.end(); ++ee) { tens b= *ee; b.getten(); } system("pause"); } Download 1.17 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling