记录详情

Compile Error

foo.cc: In function ‘int main()’:
foo.cc:6:34: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
    6 |         printf("输入年份,月份:%d");
      |                                 ~^
      |                                  |
      |                                  int
foo.cc:9:10: warning: statement has no effect [-Wunused-value]
    9 |         b<=12;
      |         ~^~~~
foo.cc:10:53: error: lvalue required as left operand of assignment
   10 |         if (b=1 || b=3 || b=5 || b=7 || b=8 || b=10 || b=12)
      |                                                  ~~~^~~~
foo.cc:11:26: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
   11 |             printf("31天%d\n");
      |                         ~^
      |                          |
      |                          int
foo.cc:13:21: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   13 |                 if(b=2 && a%4==0 && a%100!=0 && a%400==0)
      |                    ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:14:38: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
   14 |                         printf("29天%d\n");
      |                                     ~^
      |                                      |
      |                                      int
foo.cc:16:38: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
   16 |                         printf("28天%d\n");
      |                                     ~^
      |                                      |
      |                                      int
foo.cc:18:31: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
   18 |                  printf("30天%d\n");
      |                              ~^
      |                               |
      |                               int
foo.cc:5:13: warning: unused variable ‘c’ [-Wunused-variable]
    5 |     int a,b,c;
      |             ^

信息

递交者
类型
递交
题目
A1-3 分支结构练习:月份天数
比赛
南师大(含泰州学院)2024年新生赛(第一场)
语言
C++
递交时间
2024-08-15 09:09:35
评测时间
2024-08-15 09:09:35
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes