思路:
闰年: 年份是4的倍数而不是100的倍数; 年份是400的倍数.
注意大小写.
1 #include <iostream> 2 using namespace std; 3 4 int main() 5 { 6 ios::sync_with_stdio(false); 7 cin.tie(0); 8 9 int y; 10 cin >> y; 11 cout << ((y % 4 == 0 && y % 100) || (y % 400 == 0) ? "yes" : "no") << endl; 12 13 return 0; 14 }
原文:https://www.cnblogs.com/AntonLiu/p/12246751.html