Advertisement
STANAANDREY

mediemate

Nov 13th, 2018
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main () {
  6.  
  7.    float med=0;
  8.    int n,i=1,note1,note2,nrcorig=0,/*med=0*/maxi=1,snotecl=0;
  9.    cout<<"nr elevi: ";cin>>n;
  10.    while (i<=n) {
  11.     cout<<"elevu "<<i<<" a luat notele :";
  12.     cin>> note1;
  13.     cout<<" si ";
  14.     cin>>note2;
  15.    med=(note1+note2)/2;
  16.     if (med<5)
  17.         nrcorig++;
  18.     if (med>maxi)
  19.         maxi=med;
  20.     snotecl+=med;
  21.     i++;
  22.    }
  23.    cout<<"medie pe clasa:"<<(float)snotecl/(float)n<<endl;
  24.    cout<<"medie max :"<<(float)maxi<<endl;
  25.    cout<<"corigenti: "<<nrcorig;
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement