| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 148217 | 姜景文 | 18岁生日 | C++ | Compile Error | 0 MS | 0 KB | 877 | 2026-02-10 08:28:19 |
#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; }
Main.cc: In function 'int run(int)':
Main.cc:9:11: error: a function-definition is not allowed here before '{' token
int main(){
^
Main.cc:37:5: error: expected '}' at end of input
}
^