問答題

【簡答題】There are two int variables: a and b, don’t use “if”, “? :”, “switch”or other judgement statements, find out the biggest one of the two numbers.

答案: ( ( a + b ) + abs( a - b ) ) / 2
題目列表

你可能感興趣的試題

問答題

【簡答題】類成員函數(shù)的重載、覆蓋和隱藏區(qū)別是什么?

答案: A.成員函數(shù)被重載的特征:
(1)相同的范圍(在同一個類中);
(2)函數(shù)名字相同;
(3...
問答題

【簡答題】請說出const與#define 相比,有何優(yōu)點(diǎn)?

答案: 1) const 常量有數(shù)據(jù)類型,而宏常量沒有數(shù)據(jù)類型。編譯器可以對前者進(jìn)行類型安全檢查。而對后者只...
微信掃碼免費(fèi)搜題