#41668: c++解法(其實不難)


yp11351280@yphs.tp.edu.tw (810-43韓睿哲)

學校 : 臺北市私立延平高級中學
編號 : 276272
來源 : [203.72.178.1]
最後登入時間 :
2025-10-07 16:36:49

運算式而已。(&&代表{並且};||代表{或})

#include <iostream>
using namespace std;
int main()
{
    int a;
    while(cin>>a){
    if(a%4==0&&a%100!=0||a%400==0)
        cout<<"閏年"<<endl;
    else
        cout<<"平年"<<endl;
}
}