Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
4605 董语涵 [在线测评解答教程] 闰年 C++ 通过 1 MS 256 KB 653 2023-01-12 15:50:15

Tests(11/11):


#include<iostream> #include<vector> using namespace std; int main(){ int num; int year; cin >> num; vector<bool> vec; while (num--){ cin >> year; bool is_leap_year; if (year%100==0){ if (year%400==0){ is_leap_year = true; vec.push_back(is_leap_year); } else { is_leap_year = false; vec.push_back(is_leap_year); } } else if (year%4==0){ is_leap_year = true; vec.push_back(is_leap_year); } else { is_leap_year = false; vec.push_back(is_leap_year); } } for (int i=0; i<vec.size(); i++){ cout << (vec[i] == true ? "Yes":"No") << endl; } return 0; }


测评信息: