close
Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 已解決
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 已解決 
The Best Way to Manage your Money.

Start using Mint today to set a budget, track your goals and do more with your money.
From our sponsors
C語言問題,如何辦別所有元素都不相等
Mar 25th 2014, 09:31

 如提,我想破頭也不知道要用啥函數來判別

假設一個陣列好了六個數字,我想判斷這六個數字事都不相等,就輸出TRUE

想半天只會用IF把所有可能都條列式列出來的笨方法。

                             if (      num[0]==num[1]||
                num[0]==num[2]||

num[0]==num[3]||
num[0]==num[4]||
num[0]==num[5]||
num[1]==num[2]||
num[1]==num[3]||
num[1]==num[4]||
num[1]==num[5]||
num[2]==num[3]||
num[2]==num[4]||
num[2]==num[5]||
num[3]==num[4]||
num[3]==num[5]||
num[4]==num[5])
 else

 
有什麼更好的方法嗎?

 


This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers.

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜

    rhl3s1yr 發表在 痞客邦 留言(0) 人氣()