这个小程序怎么改 谢谢
#include <iostream.h>class Tdate
{
public:
void set(int m,int d, int y)
{
month=m; day=d; year=y;
}
int Isleapyear()
{
return(year%4==0&&year%100!=0)||(year%400==0);
}
void print()
{
cout<<month<<"/"<<day<<"/"<<year<<endl;
}
private:
int month; int day; int year;
}
void main() [bo]错误在这 [/bo] //Tdate' followed by 'void' is illegal (did you forget a ';'?)
{
Tdate a;
a.set(10,1,1949);
a.print();
if(a.Isleapyear)
cout<<"It is a leap year!"<<endl;
else
cout<<"It is not a leap year!"<<endl;
}