예제 #1
0
function printNumFT($fn, $sn)
{
    if ($fn == $sn) {
        echo $fn;
    } else {
        if ($fn < $sn) {
            smallToLarge($fn, $sn);
        } else {
            largeToSmall($fn, $sn);
        }
    }
}
예제 #2
0
function printOddNumFT($fn, $sn)
{
    if ($fn == $sn && !($fn % 2 == 0)) {
        echo $fn;
    } else {
        if ($fn < $sn) {
            if ($fn % 2 == 0) {
                $fn += 1;
                smallToLarge($fn, $sn);
            } else {
                smallToLarge($fn, $sn);
            }
        } else {
            if ($fn % 2 == 0) {
                $fn -= 1;
                largeToSmall($fn, $sn);
            } else {
                largeToSmall($fn, $sn);
            }
        }
    }
}