Date Format 7-6

7-6 date format (10 minutes)

Different countries have different habits of writing the date in the world. Such as the Americans used to write "Month - Day - Year", and the Chinese people are used to write "year - month - day." Below you please write a program that automatically read the format of the date the United States rewrite the date of Chinese habits.

Input formats:
input given month in accordance with the "mm-dd-yyyy" format in a row, day, and year. Topic guarantee date given is 1900 New Year's Day has a legitimate date.

Output formats:
given year, month, day in accordance with the "yyyy-mm-dd" format in a row.

Sample input:
03-15-2017

Sample Output:
2017-03-15

#include<stdio.h>


int main()
{
    int mm,yyyy,dd;

    scanf("%d-%d-%d"

Guess you like

Origin blog.csdn.net/weixin_43897032/article/details/104308132