首页 > 编程语言 > 详细

【c++程序】输入日期

时间:2015-03-07 17:14:39      阅读:254      评论:0      收藏:0      [点我收藏+]
#include<iostream>
using namespace std;
struct Date
{
	int year;
	int mon;
	int day;
};
Date input()
{
	Date d;
	cout<<"input the date (yyyy mm dd):";
	cin>>d.year>>d.mon>>d.day;
	return d;
}
int main()
 {
	 Date d=input();
	 cout<<d.year<<"年"<<d.mon<<"月"<<d.day<<"日";
	 return 0;
 }

【c++程序】输入日期

原文:http://blog.csdn.net/u012503639/article/details/44117141

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!