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. Spark Streaming的wordcount案例

    之前测试的一些spark案例都是采用离线处理,spark streaming的流处理一样可以运行经典的wordcount. 基本环境: spark-2.0.0 scala-2.11.0 IDEA-15 ...

  2. ASCII码对应表chr(num)

    chr(9) tab空格       chr(10) 换行      chr(13) 回车        Chr(13)&chr(10) 回车换行       chr(32) 空格符      ...

  3. java中的词汇

    java中的词汇: 空白符:空格,制表符,换行符.他们的存在使得代码变得很美观. 标识符:由大小写字母,数字,下划线,美元符号组成.且数字不能用于标识符第一个字符. 字面值:变量的值通常使用表示常量的 ...

  4. Android Studio 中提示 Private field 'mType' is assigned but never accessed 的原因

    Android Studio 是个很酷的编译器,之前发现有个代码提示很奇怪,但无奈一直没看懂他的意思,不过也没报错就没太在意,刚刚突然领悟了,原来是自己代码不规范. Private field 'mT ...

  5. The most orzed and orzing man

    The most orzed and orzing man 题目链接:http://acm.xidian.edu.cn/problem.php?id=1184 Sprague-Grundy定理:htt ...

  6. 4、BufferedIn(out)putStream--->字节输入/输出流的缓冲区类(高效类:高效率读写)

    前言 字节流一次读写一个数组的速度明显比一次读写一个字节的速度快很多,这是加入了数组这样的缓冲区效果,java本身在设计的时候,也考虑到了这样的设计思想(装饰设计模式后面讲解),所以提供了字节缓冲区流 ...

  7. <?php function say() { echo 'hello world'; } //在这里调用函数 say(); php 调用方法say()

    <?php function say() {     echo 'hello world'; } //在这里调用函数 say(); php 调用方法say()

  8. jquery makearray()使用

    makearray(),转换一个类似数组的对象成为真正的JavaScript数组.首先看看jquery中array的定义 makeArray: function( arr, results ) { v ...

  9. tomcat源码分析(二)启动过程

    在Catalina的load方法中,首先初始化Server组件. // Start the new server if (server instanceof Lifecycle) { try { se ...

  10. java innerclass

    ---恢复内容开始--- 内部类: public class Inner{ public class Inner2{} } 创建内部类对象 .new public class Test {    in ...