题解 | #出生日期输入输出#
出生日期输入输出
http://www.nowcoder.com/practice/4a4a9dd1edb6453ba4a0432319200743
#include<stdio.h> int main() { int ye=0; int mon=0; int dat=0; if(1990<=ye<=2015&&1<=mon<=12&&1<=dat<=30) { scanf("%4d%2d%2d",&ye,&mon,&dat); printf("year=%4d\nmonth=%02d\ndate=%02d",ye,mon,dat); } else { preatf("输入错误"); } return 0; }