Code
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n,Sum, C;
cin >> n;
int a[100000];
for (int i = 0; i < n; i++){
cin >> a[i];
}
Sum = 0;
for (int i = 0; i < n; i ++){
if (a[i] > -1){
Sum += a[i];
C += 1;
}
}
cout << C << " " << Sum;
return 0;
}
Bình luận