Смари:
#include <iostream>
using namespace std;
int main()
{
int numm = 0, rat = 0;
cin >> rat;
int A[rat];
for (int i=0; i<rat; i++)
cin >> A[i];
}
int m = A[0];
for (int i = 0; i < rat; i++)
if (A[i] > m)
m = A[i];
cout << m << endl;
for (int i = 0; i < rat; ++i)
if (m == A[i])
numm++;
cout << numm <<endl;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Смари:
#include <iostream>
using namespace std;
int main()
{
int numm = 0, rat = 0;
cin >> rat;
int A[rat];
for (int i=0; i<rat; i++)
{
cin >> A[i];
}
int m = A[0];
for (int i = 0; i < rat; i++)
{
if (A[i] > m)
{
m = A[i];
}
}
cout << m << endl;
for (int i = 0; i < rat; ++i)
{
if (m == A[i])
{
numm++;
}
}
cout << numm <<endl;
}