Advertisement
alex326

Untitled

Jan 21st, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. problema 346
  2.  
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. long long n,a,c=0,d,mx=0;
  8. cin>>n;
  9. while (n!=0){
  10. cin>>a;
  11. if (a>mx){
  12. mx=a;
  13. c=0;
  14. }
  15. if (a==mx)
  16. c++;
  17. n--;
  18. }
  19. cout<<mx<<" "<<c;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement