Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
390 B
0
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
	int mas[100];
	int count1 = 0;
	int count0 = 0;
	int n;
	for (int i = 0; i < 100; i++) {
		cin >> n;
		mas[i] = n;
		if (mas[i] == -1) {
			break;
		}
	}

	for (int i = 0; i < 100; i++) {
		if (mas[i] == 1) {
			count1 += 1;
		}
		if (mas[i] == 0) {
			count0 += 1;
		}
	}
	cout << count0 << " " << count1;
}
Leave a Comment