zoukankan      html  css  js  c++  java
  • YTU 2596: 编程题B-日期格式

    2596: 编程题B-日期格式

    时间限制: 1 Sec  内存限制: 128 MB
    提交: 981  解决: 74

    题目描述

    注:本题只需要提交编写的函数部分的代码即可。

    将输入的日期格式 月/日/年  修改为 年-月-日的格式输出 。请编写缺少的函数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

    迷失在幽谷中的鸟儿,独自飞翔在这偌大的天地间,却不知自己该飞往何方……

    #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;
    }
    void output(struct date da)
    {
        printf("%d-%d-%d",da.year,da.month,da.day);
    }
    

  • 相关阅读:
    Android软件开发之SharedPreferences
    android软件开发之获取本地音乐属性
    项目开发日记
    MVC中C给V传值
    wtf忘了已经安装了Newtonsoft.json
    我的一些容易忘记的解决问题的方法
    ajax请求返回null
    验证码的一些细节
    项目做不下去
    关于HttpContex
  • 原文地址:https://www.cnblogs.com/im0qianqian/p/5989470.html
Copyright © 2011-2022 走看看