Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- using namespace std;
- struct Elev {
- char nume[25];
- int nota;
- };
- Elev e;
- void citeste_e(Elev &e)
- {
- cout << "nume elev= ";cin >> e.nume;
- cout << "nota elev= ";cin >> e.nota;
- }
- void citeste(int &n, Elev e[])
- {
- cout << "nr elevi:";
- cin >> n;
- for (int i = 1;i <= n;i++)
- citeste_e(e[i]);
- }
- void afis_e(Elev e)
- {
- cout << e.nume<<endl;
- cout << e.nota<<endl;
- }
- void afis(int &n, Elev e[])
- {
- for (int i = 1;i <= n;i++)
- afis_e(e[i]);
- }
- Elev Min(int n, Elev e[])
- {
- Elev maxim=e[0];
- for (int i = 0;i <= n;i++)
- if (e[i].nota > maxim.nota)maxim = e[i];
- cout << "elevul cu cea mai mare nota= ";return maxim;
- }
- Elev Sort(int n,Elev e[])
- void main()
- {
- Elev e[30];
- int n;
- citeste(n, e);
- afis(n, e);
- afis_e(Min(n, e));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement