Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- short int N;
- short int MaxDigit=0;
- short int MaxDigitMod5=0;
- short int Digit;
- cin>>N;
- for(int i=0;i<N;i++)
- {
- cin>>Digit;
- if((Digit+MaxDigitMod5)%2!=0||(MaxDigit+Digit)%2!=0){
- if(Digit%5==0)
- MaxDigitMod5=Digit;
- else
- MaxDigit=Digit;
- }
- }
- if(MaxDigitMod5!=0&&MaxDigit!=0)
- cout<<MaxDigit<<" "<<MaxDigitMod5==0;
- else
- cout<<"0";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement