-->
当前位置:首页 > 题库

PROGRAMMING:Returns the week information of the date

Luz5年前 (2021-05-10)题库408
Define a date class CDATA, which has data members year, month, day, function members constructor, destructor, copy constructor, display day information function display
The getweek function returns the day of the week that the change date is expressed in English words. Read in a date from the keyboard, first display the date information of the first day of the 21st century (known as January 1, 2000 is Saturday), and then create a new date information.
The main function is as follows, without rewriting:
//Principal function
int main()
{
int y,m,d;
cin>>y>>m>>d;
CDate d0; d0.display();
cout<CDate d1(y,m,d); d1.display();
}
###Input format:
Enter a date (a date from January 1, 2000, which is legal and valid)
Space between
###Output format:
First output the date information of the first day of the 21st century
And then output the information of the specified date
###Input example:
Here is a set of inputs. For example:
```in
2000 1 31
```
###Output example:
The corresponding output is given here. For example:
```out
The first day of the 21st century:
2000-1-1:Saturday
Create a new date :
2000-1-31:Monday
```







answer:If there is no answer, please comment