Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
48831 | 冯诚阳 | 过生日 | C++ | Accepted | 1 MS | 268 KB | 453 | 2023-06-15 16:23:55 |
#include <iostream> using namespace std; int Judge(int y); int main() { int T,Y,N; cin>>T; while(T--) { cin>>Y>>N; while(N>0) { if(Judge(Y)) N--; ++Y; } cout<<Y-1<<endl; } return 0; } //判断是否是润年 int Judge(int y) { if((y%4==0&&y%100!=0)||y%400==0) return 1; else return 0; }