Gaitur Alexandr Claxi-Ac
Gaitur Alexandr Claxi-Ac
Cl a XI-a C
int main()
{struct Record
{char Nume[20];
char Prenume[30];
char Sex;
float Inaltime;
};
Record R;
typedef Record ListaElevi[50];
ListaElevi LE;
int n, i, j, k, p, l, a, b, g;
float sn, medf, medm, PlataLunara, smax ;
cout.setf(ios::fixed);cout.setf(ios::showpoint);cout.precision(2);
cout <<setw(3);
cout<<i+1<<setw(10)<<LE[i].Nume <<setw(14)<< LE[i].Prenume <<setw(10)<<
LE[i].Sex<<setw(12)<<LE[i].Inaltime<<endl;
if (LE[i].Sex=='F') {k=k+LE[i].Inaltime; a=a+1;}
if (LE[i].Sex=='M') {l=l+LE[i].Inaltime; b=b+1;}
}
medf=k/a;
medm=l/b;
cout << "________________________________________________________________" <<
endl;
cout << "Inaltimea medie a persoanelor de sex feminin: "<<medf<<endl;
cout << "________________________________________________________________" <<
endl;
cout << "Inaltimea medie a persoanelor de sex masculin: "<<medm<<endl;
cout << "________________________________________________________________" <<
endl;
cout << "Cea mai inalta persoana de sex masculin: "<< endl;
cout << "________________________________________________________________" <<
endl;
cout << " Numele : Prenumele : Inaltime "<<endl;
for (i = 0; i < n; i++)
Gaitur Alexandr
Cl a XI-a C
if (R.Inaltime<LE[i].Inaltime) R=LE[i];
cout <<setw(10) <<R.Nume <<setw(12)<< R.Prenume <<setw(15)<< R.Inaltime << endl;
cout << "_________________________________________________________________"
<<endl;
cout<<"In grupa sunt cel putin doua persoane de aceeasi inaltime: ";
for (i=0; i < n; i++)
for (j=0; j<n; j++)
if (LE[i].Inaltime==LE[j].Inaltime && i!=j) {g=g+1;}
if (g>1) cout<<"TRUE";
else cout<<"FALSE";
return 0;
}