for (int i = 0; i < 4; i++) { int iEnd = iNumber % 10; if (iEnd % 2 == 0) iMulEven *= iEnd, cMask |= 1; else iMulOdd *= iEnd, cMask |= 2; iNumber /= 10; }
if (cMask == 3) std::cout << static_cast<double>(iMulEven) / iMulOdd << std::endl; else if (cMask == 1) std::cout << "There is no odd digits exists." << iMulEven << std::endl; else std::cout << "There is no even digits exists." << iMulOdd << std::endl; return 0; } /* end of the 'main' function */
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota
Оформи подписку