北邮VC++实验题1 输出日期

发布时间 2023-04-13 19:59:12作者: 标志蛋挞

一、题目解析:

从键盘输入三个变量,分别是今天的年、月、日的数值,按格式输出今天的日期。
例如,输入2017 3 1,输出2017年3月1日
输入
2000 12 29
输出
2000年12月29日

二、思路:

1、输入三个变量

2、输出格式

四、代码实现:

#include <iostream>
using namespace std;
int main(){
int year,month,day;
cin>>year>>month>>day;
cout<<year<<""<<month<<""<<day<<"";
return 0;
}