Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. #include "bits/stdc++.h"
  2.  
  3. using namespace std;
  4.  
  5. vector <int> otv;
  6.  
  7. int q(int v){
  8. int qq = 0;
  9. while (v != 0){
  10. int cf = v%10;
  11. if (cf%2==0){
  12. qq++;
  13. }
  14. v = v/10;
  15. }
  16. return qq;
  17. }
  18.  
  19. int q2(int v){
  20. int qq = 1;
  21. while (v != 0){
  22. int cf = v%10;
  23. if (cf%2==0){
  24. qq*=cf;
  25. }
  26. v = v/10;
  27. }
  28. return qq;
  29. }
  30.  
  31.  
  32. int z[5];
  33.  
  34. int main()
  35. {
  36. int a,b,c;
  37. cin >> a >> b >> c;
  38. if (q(a)!=0 || q(b)!=0 || q(c)!=0){
  39. z[0] = a+b;
  40. z[1] = a+c;
  41. z[2] = b+c;
  42. int maxx = 0;
  43. int zz = 0;
  44. for (int i = 0; i < 3; i++){
  45. if (q(z[i]) > maxx){
  46. maxx = q(z[i]);
  47. zz = i;
  48. otv.clear();
  49. otv.push_back(q2(z[i]));
  50. } else if(q(z[i]) == maxx){
  51. otv.push_back(q2(z[i]));
  52. }
  53. }
  54. sort(otv.begin(),otv.end());
  55. cout << otv[0];
  56. } else {
  57. cout << 0;
  58. }
  59. return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement