期中考巢狀比較
非巢狀
if (r) present("#FF0000");
if (g) present("#00FF00");
if (b) present("#0000FF");
巢狀
if (r) present("#FF0000");
else if (g) present("#00FF00");
else if (b) present("#0000FF");
else alert("輸入的顏色條件,不滿足r, g, b,其他的!");
期中考
紅色
綠色
藍色
粗體
if (g) present("#00FF00");
if (b) present("#0000FF");
巢狀
if (r) present("#FF0000");
else if (g) present("#00FF00");
else if (b) present("#0000FF");
else alert("輸入的顏色條件,不滿足r, g, b,其他的!");
期中考
紅色
綠色
藍色
粗體
else if (g) present("#00FF00");
else if (b) present("#0000FF");
else alert("輸入的顏色條件,不滿足r, g, b,其他的!");
期中考
紅色 綠色 藍色
粗體
輸出
很好啦
回覆刪除