看板 EE_DSnP 關於我們 聯絡資訊
(Note: This program is to compare the modulus of two integers) Please point out the only ONE compilation error of the following program. Please explain why and suggest a way to fix it. ========================================================================= #include <iostream> #include <iomanip> using namespace std; #define MOD 8 bool operator < (const int a, const int b) { return ((a % MOD) < (b % MOD)); } int main() { int a = 20; int b = 30; cout << boolalpha << (a < b) << endl; return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.121.135.175
ric2k1:這題難易度是: 中等. 01/13 22:59
※ 編輯: ric2k1 來自: 59.121.135.175 (01/13 23:40)