Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
329 B
0
Indexable
Never
#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;
}
Leave a Comment