Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
148218 姜景文 18岁生日 C++ Compile Error 0 MS 0 KB 900 2026-02-10 08:29:51

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int run(int year){ if((year%4==0&&year%100!=0)||(year%400==0)){ return 366; }else{ return 365; } } int main(){ int T; in year; int month; int day; int s=0; cin>>t; for(int i=0;i<T;i++){ cin>>year>>month>>day; if(month==2&&day==29&&(run(year+18)==365)){ cout<<"-1"<<endl; } else{ if(((run(year)==366&&(month<=2))||(((18+year)%4==0?&&(month>=3))){ s+=266; }else{ s+=365; } for(int i=year+1;i<=(year+17);i++){ if(run(i)==366){ s+=366; } else{ s+=365; } } cout<<s; s=0; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:5: error: 'in' was not declared in this scope
     in year;
     ^
Main.cc:16:10: error: 't' was not declared in this scope
     cin>>t;
          ^
Main.cc:18:14: error: 'year' was not declared in this scope
         cin>>year>>month>>day;
              ^
Main.cc:23:60: error: expected identifier before '(' token
       if(((run(year)==366&&(month<=2))||(((18+year)%4==0?&&(month>=3))){
                                                            ^
Main.cc:23:60: error: expected ':' before '(' token
Main.cc:23:72: error: expected ')' before '{' token
       if(((run(year)==366&&(month<=2))||(((18+year)%4==0?&&(month>=3))){
                                                                        ^
Main.cc:25:43: error: expected ')' before 'else'
                                          }else{
                                           ^
Main.cc:28:40: error: expected ';' before ')' token
       for(int i=year+1;i<=(year+17);i++){
                                        ^
Main.cc:40:5: error: expected '}' at end of input
     }
     ^
Main.cc:40:5: error: expected '}' at end of input
Main.cc:15:9: warning: unused variable 's' [-Wunused-variable]
     int s=0;
         ^
Main.cc:40:5: error: expected '}' at end of input
     }
     ^