Description
注:本题只需要提交编写的函数部分的代码即可。
将输入的日期格式 月/日/年 修改为 年-月-日的格式输出 。请编写缺少的函数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;
}
Input
月/日/年
Output
年-月-日
Sample Input
6/23/2014
Sample Output
2014-6-23
HINT
#include<stdio.h>
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;
}
void output(struct date da)
{
printf("%d-%d-%d\n",da.year,da.month,da.day);
}