Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159419 张晓冉 今年的第几天 C++ Compile Error 0 MS 0 KB 542 2026-08-30 18:39:18

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int year,a,b; int s = 0; cin>>year>>a>>b; for(int i = 1;i <= a;i++){ if(i == 1 || i == 3 i == 5 || i == 7 || i == 8 || i == 10 || i == 12){ s += 31; }else if(i == 4 || i == 6 || i == 9 || i == 11){ s += 30; } if(i == 2){ if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0){ s += 29; }else{ s += 28; } } } cout<<s<<endl; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:26: error: expected ')' before 'i'
      if(i == 1 || i == 3 i == 5 || i == 7 || i == 8 || i == 10 || i == 12){
                          ^
Main.cc:14:27: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
          if(year % 4 == 0 && year % 100 != 0  || year % 400 == 0){
                           ^