Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
430 B
0
Indexable
Never
#include <iostream>

using namespace std;

int main() {
	int arr[100];
	int a;
	int count_z = 0;
	int count_1 = 0;

	for (int i = 0; i < 100; i++) {
		cin >> a;
		if (a == -1)break;
		arr[i] = a;
	}

	for (int i = 0; i < 100; i++) {
		if (arr[i] == 0) count_z += 1;
		else if (arr[i] == 1) count_1 += 1;
	}
	cout << "Quantity of 0: " << count_z << endl;
	cout << "Quantity of 1: " << count_1 << endl;
}


Leave a Comment