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".
|
相关推荐
### VMWARE SRM快速部署手册知识点详解 #### 一、准备工作 在开始部署VMware Site Recovery Manager (SRM)之前,需要确保以下几项基础组件已经准备妥当: 1. **vCenter服务器**:作为VMware环境的核心管理平台,...
Driver HASP SRM emulator (x86)
SRM空间富模型隐写分析算法,选区高维特征,使用集成分类器进行训练
根据给定的文件信息,我们将深入探讨“SRM-MDM Catalog Setup – Ready Reference”这一主题,专注于SAP NetWeaver MDM系统中的SRM-MDM目录设置过程。这份文档不仅适用于SAP SRM(Supplier Relationship Management...
SAP SRM(供应商关系管理)是一种 SAP 产品,有助于通过基于 Web 的平台采购货物。 组织可以采购所有类型的产品,如直接和间接材料,服务,这可以与 SAP ERP 模块和其他非 SAP 后端系统集成,用于会计和计划。 SAP...
SAP SRM 介绍
HASP SRM加密狗简介 HASP SRM加密狗是一种软件保护解决方案,由阿拉丁公司开发。它提供了多种型号,以满足不同业务需要。下面将对HASP SRM加密狗的各种型号进行详细介绍。 首先是HASP HL基本型,这是阿拉丁公司最...
《图像分割技术:SRM算法在MATLAB中的实现》 图像分割是计算机视觉领域中的一个核心问题,它旨在将图像划分为多个具有不同特征的区域。在这个领域中,SRM(Statistical Region Merging,统计区域合并)算法因其高效...
【标题】"VSAN与SRM"涉及到的是VMware虚拟化环境中的两个关键组件:Virtual SAN(VSAN)和Site Recovery Manager(SRM)。这两个工具在企业级数据中心中发挥着至关重要的作用,确保业务连续性和灾难恢复能力。 VSAN...
srm后端JAVA 供应商平台管理 标准物资开票表 bus_standard_invoice_out增加freeze_quantity(冻结数量这一列)。 标准物资开票表 bus_standard_invoice_out的主键为{行项目、采购订单号、物料凭证}。 标准物资...
标题中的"pe_srm_current_control_SRM_SRMAPC_SRMcontrol_电机_电流环"指出这是一个关于开关磁阻电机(Switched Reluctance Motor, SRM)电流控制的项目,其中涉及了SRM的SRMAPC(Switched Reluctance Motor ...
多年SRM实施经验总结,对希望从事SRM实施或规划的同学们有帮助
分块描述SRM系统的作用:寻源、协同和考核 涉及具体的业务用途,供前期规划作参考,可根据实际情况调整,再考虑如何实现
《深入理解SRM供应商关系管理》 在现代企业运营中,供应链管理扮演着至关重要的角色。SRM(Supplier Relationship Management)供应商关系管理是这一领域的核心组成部分,它旨在优化企业与供应商之间的互动,提升...
### SAP NetWeaver MDM – SRM Catalog Configuration #### 概述 本文档旨在总结配置SRM源系统向MDM系统提供产品目录数据的过程,这些数据将发布到SRM买家门户的EBP前端。文档主要通过截图的形式展示了配置步骤,...
开关磁阻电机(Switched Reluctance Motor, SRM)是一种特殊的电动机,其工作原理基于电磁感应,具有结构简单、成本低、效率高等特点。在本资源中,重点是SRM的三维仿真模型,使用了ANSYS Maxwell 3D这一强大的电磁...
HASP_SRM_Runtime_setup
SAP SRM用途以及功能简介 SAP SRM(Supplier Relationship Management)是一种旨在改善企业与供应商之间关系的管理思想和软件技术的解决方案。其主要目的是通过与供应商建立长期、紧密的业务关系,并通过对双方资源...
**SRM系统资源管理器详解** SRM(System Resource Manager)系统资源管理器是一个专为Linux环境设计的工具,它的主要功能是作为一个守护进程在后台持续监控非root用户的进程,以便控制系统的CPU和内存(MEM)资源...