Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream cin("input.txt");
- short n;
- cin>>n;
- long mx = -1000000001;
- short mxc = 0;
- for(int i = 0; i < n; i++)
- {
- long cur;
- cin>>cur;
- if (cur > mx)
- {
- mxc = 1;
- mx = cur;
- }
- else if (cur == mx)
- mxc++;
- }
- cout<<mx<<' '<<mxc;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement