Talabalarning tug’ilgan yiliga qarab tanlov orqali saralash
Download 459.5 Kb.
|
dasturlash13
Talabalarning tug’ilgan yiliga qarab tanlov orqali saralash #include #include using namespace std; struct talaba { char familiya[15]; char ism[15]; int tug_yil; int MTvaA; int math; int fizika; int dasturlash; float totalranks; }; void selectionsort(talaba t[], int n){ for (int i=0; i for (int j=i+1; j if(t[i].tug_yil>t[j].tug_yil) { struct talaba temp=t[i]; t[i]=t[j]; t[j]=temp; } }}} int main () { int n; cout<<"talabalar sonini kiriting: "; cin>>n; talaba t[100]; cout< cout<<"\n"< cin>>t[i].ism; cout<<"\n"< cin>>t[i].tug_yil; cout<<"\n"< cin>>t[i].MTvaA; cout<<"\n"< cin>>t[i].math; cout<<"\n"< cin>>t[i].fizika; cout<<"\n"< cin>>t[i].dasturlash; cout<<"_________________________________________________________________________"; } selectionsort(t, n); cout< for (int i=0; i cout< cout< } return 0; } Download 459.5 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling