c语言怎么输入身份证号码?答:int main() { char id[19]; // 身份证号码字符串,包括最后一位校验码和结束符'\0'int weights[] = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}; // 各位数字的权重系数 char checkcodes[] = "10X98765432"; // 校验码字符集 int i, sum = ...
用C语言求:写一个函数,从给定的身份证号中提取出生年月信息,并按日期格...答:void main(){ int len,year,month,day;char str[30],str1[10];printf("\n请输入身份证号:\n");gets(str);len=strlen(str);if(len==18){ sscanf(str, "%6c%4d%2d%2d", str1,&year,&month,&day);printf("出生日期:%d年%d月%d日\n",year,month,day);} else printf("输入错误...
c语言编程题求帮忙!!答:1, 6, 3, 7, 9, 10, 5, 8, 4, 2 };char s[20]="10X98765432";char id[20];int sum = 0,i,yushu;printf("请输入身份证号:");gets(id);for (i = 0; i<17; i++){sum = sum + (xishu[i] * (id[i] - '0'));}yushu = sum % 11;printf("%c\n", s[...
C语言设计程序判断身份证号的合法性,并输出到指定日期的天数?_百度...答:天数包括2019.4.2这天吗?include <stdio.h>#include <string.h>#include <ctype.h>#define THISYEAR 2019#define THISMONTH 4#define TODAY 2#define DATA 20190402#define MOD 11const int days[2][12]={ {31,28,31,30,31,30,31,31,30,31,30,31}, {31,29,31,...