Untitled
user_5811307
plain_text
2 years ago
367 B
12
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 << " " << one << endl;
}
Editor is loading...
Leave a Comment