Răspuns:
C++
1.
#include<iostream>
using namespace std;
int main() {
int n,i=0;
float m_a = 0;
cin >> n;
while (n % 2 != 0) {
if (n % 5 == 0) {
m_a = m_a + n;
i++;
}
cin >> n;
}
cout << m_a / i;
}
2.
#include<iostream>
using namespace std;
int main() {
int n,suma=0;
cin >> n;
while (n != 10) {
while (n != 0)
{
suma = suma + n % 10;
n = n / 10;
}
cin >> n;
}
cout << suma;
}
3.
#include<iostream>
using namespace std;
int main() {
int n,pare=0,impare=0;
cin >> n;
while (n != 0) {
if (n % 2 == 0)
pare++;
else
impare++;
cin >> n;
}
cout << "pare="<<pare<<" impare="<<impare;
}