#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; }
#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; }