记录详情

Accepted

/in/foo.cc: In member function 'int Date::day(int, int)':
/in/foo.cc:22:35: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   22 |                 if (nian % 4 == 0 && nian % 100 != 0 || nian % 400 == 0)
      |                     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/in/foo.cc:21:16: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
   21 |             if (yue == 2)
      |                ^
/in/foo.cc: In member function 'int Date::year()':
/in/foo.cc:29:31: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   29 |             if (nian % 4 == 0 && nian % 100 != 0 || nian % 400 == 0)
      |                 ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:65:24: warning: unused variable 'num' [-Wunused-variable]
   65 |     int nian, yue, ri, num;
      |                        ^~~
/in/foo.cc: In member function 'int Date::day(int, int)':
/in/foo.cc:26:9: warning: control reaches end of non-void function [-Wreturn-type]
   26 |         }
      |         ^
# 状态 耗时 内存占用
#1 Accepted 2ms 684.0 KiB
#2 Accepted 2ms 632.0 KiB
#3 Accepted 2ms 540.0 KiB
#4 Accepted 2ms 540.0 KiB
#5 Accepted 2ms 640.0 KiB

信息

递交者
类型
递交
题目
P1005 OO1-4 日期类Date
比赛
2024级《面向对象的方法与实践》第一次作业
语言
C++
递交时间
2025-03-14 23:25:16
评测时间
2025-03-14 23:25:16
评测机
分数
100
总耗时
12ms
峰值内存
684.0 KiB