📄 e-4-1.txt
字号:
// E-4-1.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include "4-1-1.h"
using namespace std;
void Date::set_date(){
cout<<"Please enter your birth year:\n";
cin>>year;
while(year<1850)
{cout<<"请输入正确年份";
cout<<"Year=";
cin>>year;
}
cout<<"Please enter your birth month:\n";
cin>>month;
while(month>13 || month<0)
{cout<<"Please enter the right month:\n";
cout<<"Month=";
cin>>month;
}
cout<<"Please enter your birth day:\n";
cin>>day;
while(day>31){
cout<<"请不要开玩笑";
cout<<"day=";
cin>>day;
}
}
void Date::disp_date(){
cout<<"You were born on the day of "<<year<<"年"<<month<<"月"<<day<<"日"<<endl;
}
void main()
{ Date b;
cout<<"Welcome!"<<endl;
b.set_date();
b.disp_date();
cout<<"Thank you for cooperation"<<endl;
system("pause");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -