SHARE
TWEET

anton

a guest Oct 23rd, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4. struct elev
  5. {char nume[10],
  6.  prenume[10];
  7.  int nota;
  8. }a[20];
  9. int n,i,j,S;
  10. int main()
  11. {cout<<"nr. de elevi:"; cin>>n;
  12.  cout<<"Datele despre elev:"<<endl;
  13.   for(i=1;i<=n;i++)
  14. {cout<<"Elevul"<<i<<": "<<endl;
  15.  cout<<"Nume:"; cin>>a[i].nume;
  16.  cout<<"prenume:"; cin>>a[i].prenume;
  17.  cout<<"Nota:"; cin>>a[i].nota;
  18.  S+=a[i].nota;
  19. }
  20.  cout<<endl<<"media clasei="<<(float)
  21.  S/n<<endl;
  22.  cout<<"afisarea elevilor promovati:"<<endl;
  23.  for(i=1;i<=n&&a[i].nota>7;i++)
  24.  cout<<a[i].nume<<" "<<a[i].prenume<<" "<<a[i].nota<<" "<<endl;
  25.  
  26.     return 0;
  27. }
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