这个类定义的不对吗
#include<iostream.h>class Cdate
{
public:
void set(int y,int m,int d);
int leapyear();
void print();
private:
int year,int month,int day;
};
void Cdate::set(int y,int m,int d)
{
year=y;
month=m;
day=d;
}
int Cdate::leapyear()
{
return(year%4==0&&year%100!=0)||(year%400==0);
}
void Cdate::print()
{
cout<<year<<"."<<month<<"."<<day<<endl;
}
void main()
{
Cdate date;
date.set(1998,6,5);
int leap=date.leapyear();
cout<<leap<<endl;
date.print();
}
小弟初学,帮忙看看这个程序有什么错误啊