课本例题
#include<stdio.h> int main() { int year, month, day; printf("请输入身份证号码: "); scanf_s("%*6d%4d%2d%2d%*d", &year, &month, &day); printf("%4d-%02d-%02d", year, month, day); return 0; }