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
 
Sample Output
He/She is from Zhejiang,and his/her birthday is on 10,12,1989 based on the table.
#include <iostream>
#include <cstdio>
using namespace std; int main()
{
char data[];
int n;
cin>>n;
while(n--)
{
cin>>data;
cout<<"He/She is from ";
if(data[]==''&&data[]=='')
cout<<"Zhejiang,";
if(data[]==''&&data[]=='')
cout<<"Beijing,";
if(data[]==''&&data[]=='')
cout<<"Taiwan,";
if(data[]==''&&data[]=='')
cout<<"Hong Kong,";
if(data[]==''&&data[]=='')
cout<<"Macao,";
if(data[]==''&&data[]=='')
cout<<"Tibet,";
if(data[]==''&&data[]=='')
cout<<"Liaoning,";
if(data[]==''&&data[]=='')
cout<<"Shanghai,";
cout<<"and his/her birthday is on ";
printf("%c%c,%c%c,%c%c%c%c based on the table.\n",
data[],data[],data[],
data[],data[],data[],data[],data[]); }
return ;
}

HDU2629:Identity Card的更多相关文章

  1. Identity Card(水题)

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

  2. Identity Card(hdu2629)

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

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

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

  4. HDU 2629 Identity Card

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

  5. 杭电2629 Identity Card

    题目意思很简单,就是根据身份证号码来确定一个人的籍贯和生日,(然而我开始脑子抽了还以为还要根据奇数偶数判断男女233333). 然后我的暴力ac代码: #include <iostream> ...

  6. hdu2629Identity Card

    Problem Description Do you own an ID card?You must have a identity card number in your family's Hous ...

  7. startssl

    Validation Success You have successfully authenticated domain "xxx.com.cn".You will be abl ...

  8. Dwarves (有向图判环)

    Dwarves 时间限制: 1 Sec  内存限制: 64 MB提交: 14  解决: 4[提交][状态][讨论版] 题目描述 Once upon a time, there arose a huge ...

  9. ORM框架Hibernate (四) 一对一单向、双向关联映射

    简介 在上一篇博客说了一下多对一映射,这里再说一下一对一关联映射,这种例子在生活中很常见,比如一个人的信息和他的身份证是一对一.又如一夫一妻制等等. 记得在Java编程思想上第一句话是“一切皆对象”, ...

随机推荐

  1. redis7--hash set的操作

    数据类型Hash(1)介绍hash数据类型存储的数据与mysql数据库中存储的一条记录极为相似Redis本身就类似于Hash的存储结构,分为key-value键值对,实际上它的Hash数据就好像是在R ...

  2. 常用的js事件

    onmouseover:鼠标放上去时触发事件 onmouseout:鼠标从上面移开时触发事件 onclick:鼠标单击事件 onfocus:获得焦点 onblur:失去焦点 onchange:下拉菜单 ...

  3. IIS的php环境配置

    session保存 再找到 session.save_path = /tmp ,将其改为 session.save_path = C:\php-4.3.2-Win32\sessions .(注:此时你 ...

  4. linux安装包资源库

    最近发现了一个很不错的linux的rpm资源库,可以在里面找到rpm安装过程中缺失的资源! 网址:http://pkgs.org/

  5. 【转】python - PyDev统一编码

    http://www.cnblogs.com/huangjacky/archive/2012/07/15/2592166.html 我们都知道Win7默认编码是GBK,而Ubuntu下面默认是utf- ...

  6. 《JS权威指南学习总结--7.8 数组方法》

    内容要点: 一.join() Array.join()方法将数组中所有元素都转化为字符串并连接在一起,返回最后生产的字符串. 可以指定一个可选的字符串在生产的字符串中来分隔数组的各个元素.如果不指定分 ...

  7. 【LeetCode】434. Number of Segments in a String

    Count the number of segments in a string, where a segment is defined to be a contiguous sequence of ...

  8. javascript的insertBefore、insertAfter和appendChild简单介绍

      target.insertBefore(newChild,existingChild)参数说明:1.target:被添加节点和现有节点的父节点.2.newChild:将要被插入的节点.3.exis ...

  9. jquery实现页面内部的内容切换

    html页面 .box-body-1-3 li{ margin: 20px; cursor: pointer;   //实现鼠标放在上面是小手状态 } 点击列表 <div class=" ...

  10. Zmodem协议

    Zmodem文件传输协议 做zeppelin测试时,自己安装了虚拟机,发现一个在linux和windows之间特别方便的命令行rz/sz工具. Install # 由于虚拟机不能上网,所以先挂载镜像. ...