Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "bits/stdc++.h"
- using namespace std;
- vector <int> otv;
- int q(int v){
- int qq = 0;
- while (v != 0){
- int cf = v%10;
- if (cf%2==0){
- qq++;
- }
- v = v/10;
- }
- return qq;
- }
- int q2(int v){
- int qq = 1;
- while (v != 0){
- int cf = v%10;
- if (cf%2==0){
- qq*=cf;
- }
- v = v/10;
- }
- return qq;
- }
- int z[5];
- int main()
- {
- int a,b,c;
- cin >> a >> b >> c;
- if (q(a)!=0 || q(b)!=0 || q(c)!=0){
- z[0] = a+b;
- z[1] = a+c;
- z[2] = b+c;
- int maxx = 0;
- int zz = 0;
- for (int i = 0; i < 3; i++){
- if (q(z[i]) > maxx){
- maxx = q(z[i]);
- zz = i;
- otv.clear();
- otv.push_back(q2(z[i]));
- } else if(q(z[i]) == maxx){
- otv.push_back(q2(z[i]));
- }
- }
- sort(otv.begin(),otv.end());
- cout << otv[0];
- } else {
- cout << 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement