题解 | #KiKi定义电子日历类#
KiKi定义电子日历类
http://www.nowcoder.com/practice/e4c67097cdb242d9a3f38b7cfe839396
很简单的题
using namespace std;
class TDate{
public:
TDate(int a=0,int b=0,int c=0){
this->year=a;
this->mon=b;
this->day=c;
}
void print(){
cout<<day<<"/"<<mon<<"/"<<year<<endl;
}
private:
double year,mon,day;
};
void test(){
double a,b,c;
cin>>a>>b>>c;
TDate t(a,b,c);
t.print();
}
int main(){
test();
return 0;
}