Untitled

 avatar
user_5811307
plain_text
2 years ago
375 B
4
Indexable
#include <iostream>
using namespace std;
#include <string>  

int main()
{	
	long long zer = 0, one = 0;
	string a;
	while (1) 
	{
		cin >> a;
		if (a.length() == 1 and a[0] == '1') break;
		for (int i = 0; i < a.length(); i++) 
		{
			if (a[i] == '1') one += 1;
			else if (a[i] == '0') zer += 1;
		}
		
	}
	cout << zer << " <=0 1=> " << one << endl;
}
Editor is loading...
Leave a Comment