| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 132733 | 蔡胤泽 | 今年的第几天 | C++ | Accepted | 1 MS | 272 KB | 406 | 2025-10-12 11:30:18 |
#include <bits/stdc++.h> using namespace std; int main() { int days[] = {31,28,31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; // leap Year 闰年 29; common year平年 28 int y, m, d; cin >> y >> m >> d; if(y % 400 == 0 || (y % 100 != 0 && y % 4 == 0)) { days[1] = 29; } int res = d; for(int i = 0;i < m - 1;i++) { res = res + days[i]; } cout << res; return 0; }