Lucian_Adrian

https://www.pbinfo.ro/probleme/3254/prod-pi

Oct 19th, 2021
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n,min=10,max=-1;
  7. cin>>n;
  8. while(n)
  9. {
  10. if(n%2==0 && n%10>max) max=n%10;
  11. if(n%2==1 && n%10<min) min=n%10;
  12. n=n/10;
  13. }
  14. cout<<min*max;
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment