- P204's solution
-
P204's Solution
- @ 2026-1-5 0:26:21
找出所有 的食品累加它们的相反数即可。
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long n, x, s = 0;
while (cin >> n)
{
s = 0;
for (int i = 1; i <= n; i++)
{
cin >> x;
if (x < 0) s -= x;
}
cout << s << endl;
}
return 0;
}