Untitled

 avatar
user_5811307
plain_text
7 months ago
367 B
1
Indexable
Never
#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 << " " << one << endl;
}
Leave a Comment