Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
4330 董语涵 [在线测评解答教程] 闰年 C++ 解答错误 0 MS 252 KB 652 2023-01-11 22:24:40

Tests(0/11):


#include<iostream> #include<vector> #include<string> using namespace std; int main(){ int year; vector<bool> vec; while (cin >> year && year != EOF) { 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; }


测评信息: