Răspuns :
Salut. Uite aici rezolvarea problemei. Succes in continuare!
#include <iostream>
using namespace std;
int main()
{
int n, MAX = 0, ap = 0, x;
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> x;
if (x > MAX)
{
MAX = x;
ap = 0;
}
if (x == MAX)
ap++; }
cout << MAX << " " << ap;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int n, MAX = 0, ap = 0, x;
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> x;
if (x > MAX)
{
MAX = x;
ap = 0;
}
if (x == MAX)
ap++; }
cout << MAX << " " << ap;
return 0;
}