L6 - B

public
yeskendir.sultanov Mar 27, 2024 Never 57
Clone
C++ l6b.cpp 17 lines (15 loc) | 303 Bytes
1
#include <bits/stdc++.h>
2
3
using namespace std;
4
5
int main() {
6
int n;
7
cin >> n;
8
int a[n], negativeCount = 0;
9
for (int i = 0; i < n; ++i) {
10
cin >> a[i];
11
if (a[i] < 0) {
12
negativeCount++;
13
}
14
}
15
cout << negativeCount;
16
return 0;
17
}