Talabalarning tug’ilgan yiliga qarab tanlov orqali saralash


Download 459.5 Kb.
Sana17.06.2023
Hajmi459.5 Kb.
#1532647
Bog'liq
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< for (int i=0; i cout<<"\n"< cin>>t[i].familiya;
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< cout<<"\nfamiliyasi | ismi | tug'ilgan yili | MTvaA | math | fizika | dasturlash | umumiy imtihon natijasi(%) |"<
for (int i=0; i
cout< cout< cout< cout< cout< cout< cout< t[i].totalranks=((t[i].MTvaA+t[i].math+t[i].fizika+t[i].dasturlash)/4.);
cout< cout<<"\n";
}
return 0;
}


Download 459.5 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling