#include <iostream>
long prodDigitExcept_2_9(int N) {
long prod = 1;
bool haveNeedDigit = false;
while (N > 0) {
int temp = N % 10;
if (temp != 2 and temp != 9) {
prod *= temp;
haveNeedDigit = true;
}
N /= 10;
}
if (haveNeedDigit)
return prod;
return -1;
}
long prodDigit(int N) {
long prod = 1;
while (N > 0) {
prod *= N % 10;
N /= 10;
}
return prod;
}
signed main() {
setlocale(LC_ALL, "Rus");
int N;
std::cin >> N;
long result = prodDigit(N);
if (result == -1)
std::cout << "В данном числе нет подходящих цифр!";
else
std::cout << result;
return 0;
}
#include <iostream>
#include <cmath>
signed main()
{
setlocale(LC_ALL, "Rus");
int cnt, countBoys = 0, countGirls = 0, sumHeightBoys = 0, sumHeightGirls = 0;
std::cout << "Введите количество детей в классе: ";
std::cin >> cnt;
int* height = new int[cnt];
for (int i = 0; i < cnt; i++)
{
std::cout << "Рост ребёнка №" << i + 1 << ": ";
std::cin >> height[i];
if (height[i] < 0) {
countBoys++;
sumHeightBoys += height[i];
}
else {
countGirls++;
sumHeightGirls += height[i];
}
}
std::cout << "Средний рост мальчиков: " << abs(sumHeightBoys) / countBoys << std::endl;
std::cout << "Средний рост девочек: " << sumHeightGirls / countGirls << std::endl;
return 0;
}
/** libraries */
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
/** libraries */
using namespace std;
/** defines */
#define ll long long
#define ld long double
#define yes cout << "YES" << "\n"
#define no cout << "NO" << "\n"
/** defines */
ld func1(ld x, ld y, ld z){
return 5 * atan(x) - (1/4) * acos(x) * ((x + 3 * abs(x-y) + pow(x,2))/(abs(x-y) * z + pow(x,2)));
}
ld func2(ld x, ld y, ld z){
return (pow(M_E,abs(x-y)) * pow(abs(x-y),x+y))/(atan(x)+atan(z)) + pow(pow(x,6) + pow(log(y),2),(1/3));
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
ld x,y,z;
cin >> x >> y >> z;
cout << func1(x,y,z) << "\n" << func2(x,y,z);
}
P.S если я где-то косякнул по невнимательности, то пишите, исправим