编程题B-日期格式
时间: 1ms 内存:128M
描述:
注:本题只需要提交编写的函数部分的代码即可。
将输入的日期格式 月/日/年 修改为 年-月-日的格式输出 。请编写缺少的函数output。
#include<stdio.h>
#include <iostream>
using namespace std;
struct date
{
int year;
int month;
int day;
};
int main()
{
struct date vd;
void output(struct date da);
scanf("%d/%d/%d",&vd.month,&vd.day,&vd.year);
output(vd);
return 0;
}
输入:
月/日/年
输出:
年-月-日
示例输入:
6/23/2014
示例输出:
2014-6-23
提示:
参考答案:
解锁文章
文章评论