Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int CountMax(int A[],int n)
- {
- int Max=A[0];
- int Count=1;
- for (int i=1;i<n;i++)
- {
- if (A[i]==Max) {Count++;}
- if (A[i]>Max) {Max=A[i]; Count=1;}
- }
- return Count;
- }
- int main()
- {
- int n;
- int *A;
- cin>>n;
- A=new int [n];
- for (int i=0;i<n;i++)
- {
- cin>>A[i];
- }
- cout<<CountMax(A,n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement