Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main () {
- float med=0;
- int n,i=1,note1,note2,nrcorig=0,/*med=0*/maxi=1,snotecl=0;
- cout<<"nr elevi: ";cin>>n;
- while (i<=n) {
- cout<<"elevu "<<i<<" a luat notele :";
- cin>> note1;
- cout<<" si ";
- cin>>note2;
- med=(note1+note2)/2;
- if (med<5)
- nrcorig++;
- if (med>maxi)
- maxi=med;
- snotecl+=med;
- i++;
- }
- cout<<"medie pe clasa:"<<(float)snotecl/(float)n<<endl;
- cout<<"medie max :"<<(float)maxi<<endl;
- cout<<"corigenti: "<<nrcorig;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement