#include<iostream>
using namespace std;
int main(void)
{
int a;
while(cin >> a)
{
if(a%400==0)
cout << "閏年";
else if(a%4==0 && a%100 != 0)
cout << "閏年";
else
cout << "平年";
}
}
自己檢查都OK,但是送審就會WA,我到底哪裡搞錯了?
#include
using namespace std;
int main(void)
{
int a;
while(cin >> a)
{
if(a%400==0)
cout << "閏年";
else if(a%4==0 && a%100 != 0)
cout << "閏年";
else
cout << "平年";
}
}
自己檢查都OK,但是送審就會WA,我到底哪裡搞錯了?
#include
using namespace std;
int main(void)
{
int a;
while(cin >> a)
{
if(a%400==0)
cout << "閏年";
else if(a%4==0 && a%100 != 0)
cout << "閏年";
else
cout << "平年";
}
}
#include<iostream>
using namespace std;
int main(void)
{
int a;
while(cin>>a)
{
if(a%400==0)
cout << "閏年"<<endl;
else if(a%4==0 && a%100 != 0)
cout << "閏年"<<endl;
else
cout << "平年"<<endl;
}
}
笨蛋,这样就行了!