#include <iostream>
using namespace std;
int main()
{ int year;
_____ isLeap(int);
cout<<"Please input year:"<<endl;
cin>>year;
if(____); cout<<year<<" is a leap year."<<endl;
else cout<<year<<" is not a leap year."<<endl;
return 0;
}
___ isLeap(int year) //判断闰年
{
return (year%4==0&&year%100!=0||year%400==0);
}
第1个回答 2012-03-25
#include <iostream>
using namespace std;
int main()
{
int year;
cout<<"Please input year:"<<endl;
cin>>year;
bool flag = isLeap( year );
if( flag )
cout<<year<<" is a leap year."<<endl;
else
cout<<year<<" is not a leap year."<<endl;
return 0;
}
bool isLeap(int year) //判断闰年
{
return (year%4==0&&year%100!=0||year%400==0);
}
using namespace std;
int main()
{
int year;
cout<<"Please input year:"<<endl;
cin>>year;
bool flag = isLeap( year );
if( flag )
cout<<year<<" is a leap year."<<endl;
else
cout<<year<<" is not a leap year."<<endl;
return 0;
}
bool isLeap(int year) //判断闰年
{
return (year%4==0&&year%100!=0||year%400==0);
}
第2个回答 2012-03-25
if(___ isLeap(year)); cout<<year<<" is a leap year."<<endl;本回答被提问者采纳
第3个回答 2012-03-25
用除余的方法!