#include<iostream>
#include<queue>
using namespace std;
queue<int> q;
int main()
{
int count=0,n,x;
cout<<"Введіть розмір черги: ";
cin>>n;
cout<<"Додайте"<<n<<"чисел до черги: ";
for(int i=0;i<n;i++)
{
cout<<"Число "<<i+1<<endl;
cin>>x;
q.push(x);
}
while(!q.empty())
{
if (q.front()%2==0)
{
count++;
}
q.pop();
}
cout<<"Кількість парних елементів черги "<<count;
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPHF1ZXVlPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpxdWV1ZTxpbnQ+IHE7CmludCBtYWluKCkKewogICAgaW50IGNvdW50PTAsbix4OwogICAKICAgIGNvdXQ8PCLQktCy0LXQtNGW0YLRjCDRgNC+0LfQvNGW0YAg0YfQtdGA0LPQuDogIjsKICAgIGNpbj4+bjsKICAgIGNvdXQ8PCLQlNC+0LTQsNC50YLQtSI8PG48PCLRh9C40YHQtdC7INC00L4g0YfQtdGA0LPQuDogIjsKICAgIGZvcihpbnQgaT0wO2k8bjtpKyspCiAgICB7CiAgICAgICAgY291dDw8ItCn0LjRgdC70L4gIjw8aSsxPDxlbmRsOwogICAgICAgIGNpbj4+eDsKICAgICAgICBxLnB1c2goeCk7CiAgICB9CiAgIAogICAgd2hpbGUoIXEuZW1wdHkoKSkKICAgIHsKICAgICAgICBpZiAocS5mcm9udCgpJTI9PTApCiAgICAgICAgewogICAgICAgICAgICBjb3VudCsrOwogICAgICAgIH0KICAgICAgICBxLnBvcCgpOwogICAgfQogICAgY291dDw8ItCa0ZbQu9GM0LrRltGB0YLRjCDQv9Cw0YDQvdC40YUg0LXQu9C10LzQtdC90YLRltCyINGH0LXRgNCz0LggIjw8Y291bnQ7CiAgIAogICAgcmV0dXJuIDA7Cn0=