1-Amaliy ish Topshirdi: 050-20 guruh talabasi Utkirov Nodir Qabul qildi
Download 221.71 Kb.
|
1-Amaliy Ish
O’zbekiston Respublikasi Axborot Texnologiyalari va Kommunikatsiyalarini Rivojlantirish Vazirligi Muhammad al-Xorazmiy nomidagi Toshkent Axborot Texnologiyalari Universiteti 1-Amaliy ish Topshirdi: 050-20 guruh talabasi Utkirov Nodir Qabul qildi: ________________ Toshkent 2022 Talabalar ism-familiyasi, yoshi va ballaridan iborat jadval yarating va talabalarni ism-familiyasini alfavit bo‘yicha tartibga keltiring. #include #include #include using namespace std; class Talaba{ public: char name[10]; char surname[12]; int age; int ball; }; bool mycomp(string a, string b){ return a} int main(){ Talaba talaba[100]; int n; cout<<"n = "; cin>>n; for (int i=0; i cout<<"enter surname: "; cin>>talaba[i].surname; cout<<"enter age: "; cin>>talaba[i].age; cout<<"enter ball: "; cin>>talaba[i].ball; } char t[10]; // sort(talaba,talaba+n, mycomp); for( int i=1; i for(int j=1; j if(strcmp(talaba[i].name,talaba[j].name)>0) { strcpy(t,talaba[i].name); strcpy(talaba[i].name, talaba[j].name); strcpy(talaba[j].name, t); } } } cout<<"\nsaralangan malumotlar: \n"; for (int i=0; i cout< } Download 221.71 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling