Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
5244 | A班-许锘林 | 18岁生日 | C++ | 解答错误 | 0 | 1 MS | 252 KB | 605 | 2025-01-24 14:42:50 |
#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; } 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; }