记录详情

Accepted

/in/foo.cc: In member function 'int Date::day(int, int)':
/in/foo.cc:28:35: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   28 |                 if (nian % 4 == 0 && nian % 100 != 0 || nian % 400 == 0)
      |                     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/in/foo.cc:27:16: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
   27 |             if (yue == 2)
      |                ^
/in/foo.cc: In member function 'int Date::year()':
/in/foo.cc:35:31: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   35 |             if (nian % 4 == 0 && nian % 100 != 0 || nian % 400 == 0)
      |                 ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/in/foo.cc: In constructor 'Date::Date(int, int, int, int, int, int, int, int, int, int, int, int)':
/in/foo.cc:18:9: warning: 'Date::ri1' will be initialized after [-Wreorder]
   18 |     int ri1;
      |         ^~~
/in/foo.cc:7:9: warning:   'int Date::shi' [-Wreorder]
    7 |     int shi;
      |         ^~~
/in/foo.cc:42:9: warning:   when initialized here [-Wreorder]
   42 |         Date(int y, int m, int d, int y1, int m1, int d1,int h, int mm, int s,int h1,int mm1,int s1) : nian(y), yue(m), ri(d), nian1(y1), yue1(m1), ri1(d1),shi(h), fen(mm), miao(s),shi1(h1), fen1(mm1), miao1(s1) {}
      |         ^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:75:24: warning: unused variable 'num' [-Wunused-variable]
   75 |     int nian, yue, ri, num;
      |                        ^~~
/in/foo.cc: In member function 'int Date::day(int, int)':
/in/foo.cc:32:9: warning: control reaches end of non-void function [-Wreturn-type]
   32 |         }
      |         ^
# 状态 耗时 内存占用
#1 Accepted 3ms 728.0 KiB
#2 Accepted 2ms 656.0 KiB
#3 Accepted 2ms 640.0 KiB
#4 Accepted 2ms 576.0 KiB
#5 Accepted 2ms 580.0 KiB

信息

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