SHARE
TWEET

labPOO

a guest Feb 21st, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <stdio.h>
  3.  
  4. using namespace std;
  5. struct Elev {
  6.     char nume[25];
  7.     int nota;
  8. };
  9. Elev e;
  10. void citeste_e(Elev &e)
  11. {
  12.     cout << "nume elev= ";cin >> e.nume;
  13.     cout << "nota elev= ";cin >> e.nota;
  14. }
  15. void citeste(int &n, Elev e[])
  16. {
  17.     cout << "nr elevi:";
  18.     cin >> n;
  19.     for (int i = 1;i <= n;i++)
  20.         citeste_e(e[i]);
  21. }
  22. void afis_e(Elev e)
  23. {
  24.     cout << e.nume<<endl;
  25.     cout << e.nota<<endl;
  26. }
  27. void afis(int &n, Elev e[])
  28. {
  29.     for (int i = 1;i <= n;i++)
  30.         afis_e(e[i]);
  31. }
  32. Elev Min(int n, Elev e[])
  33. {
  34.     Elev maxim=e[0];
  35.     for (int i = 0;i <= n;i++)
  36.         if (e[i].nota > maxim.nota)maxim = e[i];
  37.     cout << "elevul cu cea mai mare nota= ";return maxim;
  38. }
  39. Elev Sort(int n,Elev e[])
  40.  
  41. void main()
  42. {
  43.     Elev e[30];
  44.     int n;
  45.     citeste(n, e);
  46.     afis(n, e);
  47.     afis_e(Min(n, e));
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top