Untitled

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

int main()
{
	setlocale(LC_ALL, "Russian");
	int one = 0, nol = 0, i = 0;
	int mas[100];
	while (mas[i] != -1) {
		cin >> mas[i];
		if (mas[i] == 1) {
			one++;
		}
		else {
			nol++;
		}
	}

	cout << "Каличество 1: " << one << " Каличество нулей: " << nol;
}
Leave a Comment