Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
529 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
    int mass[100];
    int i = 0;
    int n;
    cin >> n;
    while (n != -1)
    {
        mass[i] = n;
        i++;
        cin >> n;
    }
    int count1 = 0, count2 = 0;
    for (int c = 0; c < i; c++)
    {
        if (mass[c] == 0)
        {
            count1++;
        }
        else
            if (mass[c] == 1)
            {
                count2++;
            }
    }
    cout << count1 << ' ' << count2 << endl;

    return 0;
}
Leave a Comment