代码文本:
#include "stdio.h"
int main(int argc,char *argv[]){
char a[19];
int y,m,d;
printf("Please enter the id number...\n");
if(scanf("%18[0-9xX]",a)!=1){
printf("Input error, exit...\n");
return 0;
}printf("%s\n",a);
sscanf(a+6,"%4d%2d%2d",&y,&m,&d);
printf("The result is:\n%-6d%6.02d%6.02d%6d\n",y,m,d,y+m+d);
return 0;
}