GetBirthDate function is a id number of the date of birth to integer
# include
Void GetBirthDate (char * s) {
Int I, j=0;
For (I=6; i <14. I++) {
J *=10;
J +=s [I] - '0';
}
}
Int main (void) {
Char [] id="51010219990506001 x";
Int the date=0, year, month, day.
The date=GetBirthDate (id);
Year=date/10000;
The month=date/100% 100;
Day=date & amp; 100;
Printf (" % d % % 4 d - 02-02 d \ n ", year, month, day);
return 0;
} CodePudding user response: