Advertisement
STANAANDREY

notamax

Nov 12th, 2018
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main () {
  6. int n,i=1,x,maxi=1,nr=1;
  7. cout<<"nr note=";cin>>n;
  8.  
  9.  
  10. while (i<=n)
  11. {
  12.     cout<<"nota"<<i<<'=';
  13.     cin>>x;
  14.     if (x>maxi)
  15.     {
  16.         maxi=x;
  17.         nr=1;
  18.     }
  19.     else if (x==maxi)
  20.         nr++;
  21.         i++;
  22. }
  23. if (nr==1)
  24. cout<<nr<<" elev a luat "<<maxi<<endl;
  25. else
  26.     cout<<nr<<" elevi au luat "<<maxi<<endl;
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement