Ответы
Ответ дал:
0
#include <iostream>
#include <strstream>
int main()
{
int n;
std::cin >> n;
int count =0, even=0;
std::strstream str;
str << n;
char ch;
while (str.get(ch)){
count++;
even += ((ch % 2) + 1) % 2;
}
std::cout << "The number of digits " << count << " of them even " << even << std::endl;
return 0;
}
#include <strstream>
int main()
{
int n;
std::cin >> n;
int count =0, even=0;
std::strstream str;
str << n;
char ch;
while (str.get(ch)){
count++;
even += ((ch % 2) + 1) % 2;
}
std::cout << "The number of digits " << count << " of them even " << even << std::endl;
return 0;
}
Вас заинтересует
2 года назад
2 года назад
7 лет назад
10 лет назад
10 лет назад
10 лет назад