题解 | #出生日期输入输出#
出生日期输入输出
http://www.nowcoder.com/practice/4a4a9dd1edb6453ba4a0432319200743
#include <stdio.h> int main () { int brithday; scanf("%d", &brithday); int year=brithday/10000; printf("year=%d\n",year); int month=brithday%10000/100; if(month>=10){ printf("month=%d\n",month); }else{ printf("month=0%d\n",month); } int date=brithday%100; if(date>=10){ printf("date=%d\n",date); }else{ printf("date=0%d\n",date); } return 0; }