Run ID:145221

提交时间:2026-01-25 09:55:16

#include <iostream> using namespace std; // 判断是否是闰年的函数 bool isLeapYear(int year) { if (year % 400 == 0) { return true; // 是闰年 } else if (year % 100 == 0) { return false; // 不是闰年 } else if (year % 4 == 0) { return true; // 是闰年 } else { return false; // 不是闰年 } } int main() { int a, b, c; cin >> a >> b >> c; // 输入三个年份 int count = 0; // 统计闰年个数 if (isLeapYear(a)) count++; if (isLeapYear(b)) count++; if (isLeapYear(c)) count++; cout << count << endl; // 输出闰年个数 return 0; }