Source Code
#include<string>
#include <iostream>
using namespace std;


int main() {




	int n, max = 1;
	cin >> n;
	int a[100000];

	for (int i = 0; i < n; i++)
		cin >> a[i];
	bool f = false;
	for (int i = 0; i < n; i++)
	{

		if (a[i] < 0)
		{
			if (a[i] < max)
				max = a[i];
			f = true;

		}

	}
	if (f)
		cout << abs(max);
	else

		cout << 0;
}
Copy
Zeina The Business Owner hatamleh
GNU G++17
3 ms
756 KB
Wrong Answer