Untitled
unknown
c_cpp
2 years ago
329 B
6
Indexable
#include <iostream>
using namespace std;
int main()
{
int i;
cin >> i;
int suma = 0;
int max_detail = 0;
int y[9999] = {};
for (int p = 0; p < i; p++)
{
cin >> y[p];
suma += y[p];
if (y[p] > max_detail)
{
max_detail = y[p];
}
}
cout << suma << " " << max_detail;
}Editor is loading...
Leave a Comment