Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

bggw

<?php
$a = array();
$n = (int)fgets(STDIN);
$mch1 = 101;
$mch2 = 101;
$mne1 = 101;
$mne2 = 101;
$min1 = 0;
$min2 = 0;

for($i=1;$i<=$n;$i++) {
    $x = (int)fgets(STDIN);
    
    if($x<0) {
        $sum = $sum + $x;
        if(($x%2 == 0)and($x < $mch1)) {
           $mch1 = $x; 
        }
        if(($x%2 != 0)and($x < $mne1)) {
           $mne1 = $x; 
        }
    } else if(x>0) {
        if(($x%2 == 0)and($x < $mch2)) {
           $mch2 = $x; 
        }
        if(($x%2 != 0)and($x < $mne2)) {
           $mne2 = $x; 
        }
    }
    
    
    if($sum%2 != 0) {
        
    }
}

if((($mch1 == 101)or($mch2 == 101))and(($mne1 == 101)or($mne2 == 101))) {
    echo 'NO';
}
?>

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.