Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
5249 A班-许锘林 18岁生日 C++ 解答错误 0 1 MS 252 KB 653 2025-01-25 11:27:00

Tests(0/1):


#include <bits/stdc++.h> using namespace std; bool year(int n) { if(n % 400 == 0 || (n % 4 == 0 && n % 100 != 0)) { return true; } else { return false; } } int main() { int nn,yy,rr; char g1,g2; int n; cin>>n; for(int i = 0;i < n;i++) { int temp = 0; cin>>nn>>g1>>yy>>g2>>rr; if(yy == 2 && rr == 29) { cout<<-1<<endl; continue; } if(year(nn) && yy < 2) { temp++; } nn++; int NN = nn + 17; for(int j = nn;j <= NN;j++) { if(year(j)) { temp += 366; } else { temp += 365; } } cout<<temp<<endl; } return 0; }


测评信息:

输入

11
1989-11-26
1962-12-02
1963-03-27
1990-03-31
1900-02-28
2000-02-29
2008-08-08
1995-02-28
2012-02-29
2020-02-28
1982-03-01

输出

6574
6575
6575
6575
6574
-1
6574
6575
-1
6574
6575

答案

6574
6575
6575
6575
6574
-1
6574
6575
-1
6575
6575

系统信息

exit code: 0, checker exit code: 0