科目名稱:資訊系統 與網路導論 | 開課系所:資訊工程 學系 | 任課教師 |
吳坤熹 |
||
系所別: |
年級: |
學號: |
姓名: |
考試日期 |
2007.11.14 |
(考試時間: 13:10-13:30)
#include<iostream>
int main() // Quiz 4-2: Understanding bitwise operators.
{
unsigned s = 555;
int i = (s >> 4) & ~(~0 << 3);
std::cout << i;
}
#include <iostream>
int main()
{
const int MAX = 20;
int i = 1, sum = 0;
loop: sum += i; // Add current value of i to sum
if (++i <= MAX)
goto loop; // Go back to loop
std::cout << std::endl << "sum = " << sum
<< std::endl << "i = " << i
<< std::endl;
return 0;
}