当前位置:网站首页>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
边栏推荐
- 因美纳陷数据泄露“丑闻”:我国基因数据安全能交给美企吗?
- Storage structure of graph
- This kind of people began to be robbed by VC with a monthly salary of 80000 yuan
- 在线JSON转PlainText工具
- Golang - the difference between new and make
- pytorch实现kaggle猫狗识别
- Detect objects and transfer images through mqtt
- [js]var, let, const
- ICML 2022: UFRGS |作为最优策略转移基础的乐观线性支持和后继特征
- 往前一步是优秀,退后一步是懵懂
猜你喜欢

【tinyriscv verilator】分支移植到正点原子达芬奇开发板

Online JSON to plaintext tool

Spug - 轻量级自动化运维平台

在线JSON转PlainText工具

跨系统数据一致性问题解决方案汇总

Prediction of benign / malignant breast tumors (logistic regression classifier)

Working at home is more tiring than going to work at the company?

打造南沙“强芯”,南沙首届IC Nansha大会召开

vmware虚拟机桥接连通

【PCL自学:Segmentation3】基于PCL的点云分割:区域增长分割
随机推荐
To build a "strong core" in Nansha, the first IC Nansha conference was held in Nansha
Course strategy sharing plan of Zhejiang University
文献综述如何挑选文献进行阅读,比如我的检索结果有200多篇根本看不完,如何进行文献挑选呢?...
C WinForm reads the resources picture
超纲练习题不超纲
【PCL自学:Segmentation3】基于PCL的点云分割:区域增长分割
Discuz taobaoke website template / Dean taobaoke shopping style commercial version template
Halcon's region: features of multiple regions (6)
Golang - the difference between new and make
Typora 1.2.5等版本下载
Swing UI container (I)
Introduction to quantitative trading
【剑指Offer】47. 礼物的最大价值
消除el-image图片周围间隙
matlab axis坐标轴相关设置详解
Working at home is more tiring than going to work at the company?
vivado VIO IP的用法
seata
seata
第 2 章 集成 MP