Problem Description
Do you own an ID card?You must have a identity card number in your family’s Household Register. From the ID card you can get specific personal information of everyone. The number has 18 bits,the first 17 bits contain special specially meanings:the first 6 bits represent the region you come from,then comes the next 8 bits which stand for your birthday.What do other 4 bits represent?You can Baidu or Google it.
Here is the codes which represent the region you are in.

However,in your card,maybe only 33 appears,0000 is replaced by other numbers.
Here is Samuel’s ID number 331004198910120036 can you tell where he is from?The first 2 numbers tell that he is from Zhengjiang Province,number 19891012 is his birthday date (yy/mm/dd).

Input
Input will contain 2 parts:
A number n in the first line,n here means there is n test cases. For each of the test cases,there is a string of the ID card number.

Output
Based on the table output where he is from and when is his birthday. The format you can refer to the Sample Output.

Sample Input

1
330000198910120036
2
810000190005120072

Sample Output

He/She is from Zhejiang,and his/her birthday is on 10,12,1989 based on the table.
He/She is from Hong Kong,and his/her birthday is on 05,12,1900 based on the table.

#include<iostream>
#include<stdio.h>#include<string.h>
using namespace std;
int main()
{ char a[8][10] ={"Zhejiang" , "Beijing" , "Taiwan","Hong Kong","Macao","Tibet","Liaoning","Shanghai"};char b[8][3] ={"33" ,"11","71" ,"81" ,"82","54" ,"21" ,"31"};int n,i ;char c[19];cin>>n;getchar();while(n--){ gets(c);for(i=0;i<8;i++){if(strncmp(c,b[i],2)==0)break;}cout<<"He/She is from "<<a[i]<<",and his/her birthday is on "<<c[10]<<c[11]<<","<<c[12]<<c[13]<<","<<c[6]<<c[7]<<c[8]<<c[9]<<" based on the table."<<endl;}return 0;}

八、Identity Card相关推荐

  1. 【acm2629】 Identity Card

    **题目: Problem Description Do you own an ID card?You must have a identity card number in your family' ...

  2. H - Identity Card

    H - Identity Card Do you own an ID card?You must have a identity card number in your family's Househ ...

  3. 杭电OJ 2629 Identity Card(C++)

    Identity Card Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...

  4. HDU 2629 Identity Card

    简单题 给出身份证号 判断住址 和出生年月 熟练字符串的操作 主要是string::substr(s, l)//s:起始位置 l长度 1 #include <iostream> 2 #in ...

  5. hdu 2629 Identity Card (字符串解析模拟题)

    这题是一个字符串模拟水题,给12级学弟学妹们找找自信的,嘿嘿; 题目意思就是要你讲身份证的上的省份和生日解析出来输出就可以了: http://acm.hdu.edu.cn/showproblem.ph ...

  6. 【2629】Identity Card 【比较坑 / 水题】

    http://acm.hdu.edu.cn/showproblem.php?pid=2629 地区只要看前两位就可以了,因为地区是个大的概念后面的数字代表的是县 #include<cstdio& ...

  7. HDU Identity Card

    注意输出格式,是一句话,一定要带"." 再之后就是按月/日/年输出 题目看清楚33后面的4个0可以被其他的数字代替. #include<iostream> #inclu ...

  8. HDU steps 1.2.6 Identity Card

    分析: 题目没有太大的难度,使用java中的HashMap存储表,然后可以很方便的使用put.get来查表,找到对应代码.  同时用Strng的substrng 可以很方便的提取出想要的资料信息.代码 ...

  9. Identity Card

    感觉直接字符匹配就可以了. #include<stdio.h> #include<string.h>char area(char a, char b) {char c;swit ...

  10. Identity Card(hdu2629)

    输入方式:先输入一个整型,再输入不带空格未知长度/已知长度的字符串. 思考:用scanf_s()函数输入整型,再循环输入不带空格未知长度的字符串,用gets_s()函数. 注意:scanf_s()函数 ...

最新文章

  1. 求助:Event ID:10021日志错误的解决方法
  2. 读博士以后如果不去科研岗位,那它的意义在哪里?
  3. C/C++变量在嵌套域内可见
  4. 转载:矩阵的掩膜操作实现图像对比度调整
  5. 精读《谈谈 Web Workers》
  6. Windows 下git 与 github 相关联
  7. 1-概述程序构成基本元素
  8. iOS开发_统计xcode代码行数
  9. 《信息安全系统设计基础》第六周学习总结
  10. linux安装yum
  11. 北斗高精度卫星接收机的分类
  12. 台达DVP PLC与3台西门子V20变频器通讯程序 台达PLC与3台西门子变频器通讯
  13. Primeng CascadeSelect UI显示BUG解决方案
  14. 全网惟一面向软件测试人员的Python基础教程-在Python中怎么干倒字符串?
  15. Demo---progress-steps------ 2/50(详解)
  16. (附源码)计算机毕业设计ssm城市智能公交系统
  17. 防止表单重复提交的问题
  18. 【行为管理篇】02. 路由模式连接 ❀ 深信服上网行为管理
  19. 37游戏叫板外国进口 用设计抢滩市场才是硬道理
  20. miniSD卡分区后的再次完成格式化

热门文章

  1. 论文阅读:Securely Outsourcing Neural Network Inferenceto the Cloud with Lightweight Techniques
  2. linux dot命令,DOT语言使用笔记(1)
  3. 如梦若梦,肾盂肾炎似烟火
  4. 小程序下拉刷新没有响应
  5. 人人商城互动直播(与通信服务器连接失败)
  6. 【第八期送书活动】+ 购书福利
  7. 萌新的linux之旅27
  8. Unity3d之坦克对战游戏 AI设计
  9. python英文文本分析和提取_Python实现英文新闻摘要自动提取
  10. 使用python开发多人一对一聊天系统(文字聊天,视频通讯,文件传输)