当前位置:首页计算机类软件水平考试初级程序员->为减少手工输入数字代码是发生的错误,常用的手段是在数字代码上

为减少手工输入数字代码是发生的错误,常用的手段是在数字代码上增设验位。例如,第二代身份证号共有18位,其中左17位是数字代码,尾部一位是校验位。

设i(i=1..18)表示第二代身份证从右到左的各位编号,Ai(i=2..18)表示身份证号第i位上数字,则校验位Ai上的数字可以按以下方法计算:

r=(A2W2+A3W3+…+A18W18)mod 11

其中,Wi=2(i-1次方)mod 11,A1=(12-r)mod 11

如果A1=10,则以“X”表示。

设某人的身份证号代码如下表中的Ai(i=2…18)所示:

则校验位A1=( )。

初级程序员,历年真题,2011年下半年《程序员》真题

  • A.4
  • B.5
  • C.6
  • D.X
查看答案 纠错
答案: B
本题解析:

r= A2W2+A3W3+…+A18W18) mod 11 = (A18W18+A17W17+…+A2W2) mod 11=(1*7+1*9+0*10+……+0*4+2*2) mod 11=161 mod 11=7

A1=(12-r)mod 11=(12-7) mod 11=5

更新时间:2021-12-01 17:40

你可能感兴趣的试题

单选题

( )is a method or procedure for carrying out a task.

  • A.Thought
  • B.Ideality
  • C.Algorithm
  • D.Creation
查看答案
单选题

One of the major features in C++( )handling,which is a better way of handling errors.

  • A.data
  • B.pointer
  • C.test
  • D.exception
查看答案
单选题

( )of database refers to the protection of data against unauthorized disclosure, alteration,or destruction.

  • A.Security
  • B.Access
  • C.Backup
  • D.Creation
查看答案
单选题

We consider a( )successful only when an error is discovered.

  • A.design
  • B.program
  • C.development
  • D.test
查看答案
单选题

In C language,( )consists of variables and constants connected by operators.

  • A.an expression
  • B.a subroutine
  • C.a function
  • D.a loop
查看答案
单选题

在 Windows 系统中,通过安装( )组件来创建 FTP 站点。

  • A.DNS
  • B.IIS
  • C.POP3
  • D.Telnet
查看答案
单选题

在地址栏中输入www.abc.com,浏览器默认的协议是( )。

  • A.HTTP
  • B.DNS
  • C.TCP
  • D.FTP
查看答案
单选题

在 HTML 中,表格边框的宽度由( )属性指定。

  • A.width
  • B.height
  • C.border
  • D.cellpadding
查看答案
单选题

以下 IP地址中,( )可以指定给因特网接口。

  • A.10.110.33.224
  • B.40.94.255.10
  • C.172.16.17.18
  • D.192.168.22.35
查看答案
单选题

随着社会信息化程度的迅速提高,我们已经进入了大数据时代。数据量的单位也在不断扩展 :B、KB、MB、GB、TB、PB、EB、ZB 等,后者是前者的 1024 倍。因此, 1EB= ( )GB。

  • A.1 K
  • B.1 M
  • C.1G
  • D.1 T
查看答案