当前位置:网站首页>C language - date formatting [easy to understand]
C language - date formatting [easy to understand]
2022-06-27 23:36:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
7-12 Date formatting (5 branch )
Different countries in the world have different habits of writing dates . For example, Americans are used to writing “ month - Japan - year ”, And the Chinese are used to writing “ year - month - Japan ”. Now please write a program , Automatically change the date in American format into the date used by China .
Input format :
Type in a line and press “mm-dd-yyyy” To the moon 、 Japan 、 year . The date given in the title guarantee is 1900 The legal date from New Year's day to the present .
Output format :
In a row, press “yyyy-mm-dd” The format gives the year 、 month 、 Japan .
sample input :
03-15-2017sample output :
2017-03-15Program :
#include <stdio.h>
int main()
{
int year, month, day;
scanf("%d-%d-%d", &month, &day, &year);
printf("%d-%02d-%02d\n", year, month, day);
return 0;
}Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/133151.html Link to the original text :https://javaforall.cn
边栏推荐
猜你喜欢
![[Blue Bridge Cup training 100 questions] scratch digital calculation Blue Bridge Cup competition special prediction programming question collective training simulation exercise question No. 16](/img/7c/d4ea8747ce45fd2eb59a8f968653db.png)
[Blue Bridge Cup training 100 questions] scratch digital calculation Blue Bridge Cup competition special prediction programming question collective training simulation exercise question No. 16

How to set the enterprise wechat group robots to send messages regularly?

C language character pointer and string initialization

EXCEL 打印设置公共表头

使用SQL进行数据去重的N种方法

捷码赋能案例:湖南天辰产研实力迅速提升!实战玩转智慧楼宇/工地等项目
![Technical implementation process of easycvr platform routing log function [code attached]](/img/cc/f4f81cbb72d2d43430a8d15bbbf27b.png)
Technical implementation process of easycvr platform routing log function [code attached]

2022年PMP项目管理考试敏捷知识点(3)

What if Fiddler fails to listen to the interface

圖的存儲結構
随机推荐
Detect objects and transfer images through mqtt
The choice and trade-off between vector recall and literal recall
使用SQL进行数据去重的N种方法
【AI应用】NVIDIA GeForce RTX 1080Ti的详情参数
Feign通过自定义注解实现路径的转义
Small chip chiplet Technology
golang使用mongo-driver操作——查(进阶)
Classification of cifar-10 dataset with pytorch
[Blue Bridge Cup training 100 questions] scratch digital calculation Blue Bridge Cup competition special prediction programming question collective training simulation exercise question No. 16
圖的存儲結構
Structure de stockage des graphiques
Working at home is more tiring than going to work at the company?
量化交易入门教程
seata
解决新版chrome跨域问题:cookie丢失以及samesite属性问题「建议收藏」
ICML 2022:ufrgs | optimistic linear support and subsequent features as the basis for optimal strategy transfer
Senior headhunting team manager: interviewed 3000 consultants, summarized and organized 8 commonalities (Mao Sheng)
[js]var, let, const
官宣!Apache Doris 从 Apache 孵化器毕业,正式成为 Apache 顶级项目!
EXCEL 打印设置公共表头