向各位請教
測試執行通過,但送出後卻為wa1為什麼呢?
#include <iostream>
using namespace std;
int main()
{
int year;
cin>>year;
if (year%4==0 && year%400==0 && year%100!=0)
{
cout<<"閏年";
}
else
{
cout<<"平年";
}
return 0;
}
感謝
#include <iostream>
using namespace std;
int main()
{
int year;
cin>>year;
if (year%4==0 || year%400==0 || year%100!=0)<--是||不是&&
{
cout<<"閏年";
}
else
{
cout<<"平年";
}
return 0;
}