This problem statement contains superscripts and/or subscripts. These may not display properly outside the applet.
In People's Republic of China, every citizen has a unique ID string. The length of the ID is 18 characters. The first 17 ch
aracters (called the body code) are all digits, the last character (called the checksum code) can be either a digit or 'X'.
The body code is then divided into three parts: from left to right, these are the region code, the birthday code, and the sequential code. They look as follows:
- The region code has 6 digits. Some 6-digit strings represent regions, other 6-digit strings are invalid. You are given the valid region codes as a String[]regionCodes.
- The birthday code has 8 digits. It gives the citizen's birthday in the form YYYYMMDD. That is, the first 4 digits is the year of birth, the next 2 is the month (01 to 12, with a leading zero if necessary), and the last 2 digits is the day. When verifying the birthday code, you should consider leap years (see the Notes). Additionally, a valid birthday code must represent a date between Jan 1, 1900 and Dec 31, 2011, inclusive.
- The sequential code has 3 digits. These 3 digits may be arbitrary, with one exception: the sequential code "000" is invalid. If the sequential code represents an odd number (e.g., "007"), the person is a male. Otherwise (e.g., "420") the person is a female.
The last character of an ID string is the checksum code. This is derived from the first 17 digits. Let a1, a2, ..., a17 denote the body code from left to right. Consider the following modular equation: x + a1*217 + a2*216 + a3*215 + ... + a16*22 + a17*21 = 1 (mod 11). This equation always has exactly one solution x such that 0 <= x <= 10. If x=10, the checksum code is 'X'. Otherwise, the checksum code is the corresponding digit. (E.g., if x=5, the checksum code is '5'.)
You are given a String id. If this is not a valid ID string, return "Invalid" (quotes for clarity). If id represents a valid ID string of a male citizen, return "Male". Finally, if idrepresents a valid ID string of a female citizen, return "Female".
|
相关推荐
Driver HASP SRM emulator (x86)
SAP SRM 介绍
srm后端JAVA 供应商平台管理 标准物资开票表 bus_standard_invoice_out增加freeze_quantity(冻结数量这一列)。 标准物资开票表 bus_standard_invoice_out的主键为{行项目、采购订单号、物料凭证}。 标准物资...
分块描述SRM系统的作用:寻源、协同和考核 涉及具体的业务用途,供前期规划作参考,可根据实际情况调整,再考虑如何实现
多年SRM实施经验总结,对希望从事SRM实施或规划的同学们有帮助
HASP_SRM_Runtime_setup
SRM空间富模型隐写分析算法,选区高维特征,使用集成分类器进行训练
简叙什么是SRM,SRM解决什么问题,SRM有用途,SRM功能等
SRM210 (PA)SAP SRM Server Configuration (Col92) Configuration
SRM影像分割算法的matlab程序,主函数SRM_new
SRM Overview中文版让你更直观更容易了解SRM是什么,能做什么
不仅可以阅读srm格式文件,还可以制作文档。完全绿色破解,是一款不错的srm阅读器。
SAP SRM(供应商关系管理)是一种 SAP 产品,有助于通过基于 Web 的平台采购货物。 组织可以采购所有类型的产品,如直接和间接材料,服务,这可以与 SAP ERP 模块和其他非 SAP 后端系统集成,用于会计和计划。 SAP...
ASP SRM USB Command Line Dumper Instructions. HASP SRM USB命令行转储指令。 WARNING!!! Before make dump from dongle make sure that you install the original dongle driver. Insert your LPT or USB dongle...
HASP SRM加密狗简介,阿拉丁公司的各种加密够简介
不错的VMware SRM资料,可以看看
Hasp SRM 32bit usb virtual driver source code.
SRM基本功能介绍.pdf
为解决西山煤电集团东曲矿异步电机转子切电阻调速2JK-2.5×1.2型提升机可靠性差、耗能严重、成本高、效率低等缺陷,采用SRM结构调速控制提升机运行。SRM结构利用磁阻最小原理进行工作,由磁极绕组、不对称的拓扑等结构...
Workflow Guide SAP SRM 2007