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<stdio.h>
#include<string.h>
#include<iostream>
#include<map>
using namespace std;
char a[20],mp[88][15];
int main()
{
int n,y,m,d,dd;
strcpy(mp[33],"Zhejiang");
strcpy(mp[82],"Macao");
strcpy(mp[11],"Beijing");
strcpy(mp[54],"Tibet");
strcpy(mp[71],"Taiwan");
strcpy(mp[21],"Liaoning");
strcpy(mp[81],"Hong Kong");
strcpy(mp[31],"Shanghai");
scanf("%d",&n);
while(n--)
{
scanf("%s",a);
dd=0; y=0;
for(int i=0;i<2;i++) dd=dd*10+a[i]-'0';
for(int i=6;i<=9;i++) y=y*10+a[i]-'0';
printf("He/She is from %s,and his/her birthday is on ",mp[dd]);
printf("%c%c,%c%c,%d",a[10],a[11],a[12],a[13],y);
printf(" based on the table.\n");
}
}

 

hdu2629Identity Card的更多相关文章

  1. Lesson 3 Please send me a card

    Text Postcards always spoil my holidays. Last summer, I went to Italy. I visited museums and sat in ...

  2. iOS - Card Identification 银行卡号识别

    1.CardIO 识别 框架 GitHub 下载地址 配置 1.把框架整个拉进自己的工程,然后在 TARGETS => Build Phases => Link Binary With L ...

  3. HDOJ 4336 Card Collector

    容斥原理+状压 Card Collector Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/O ...

  4. Opensuse enable sound and mic card

    Install application pavucontrol Run pavucontrol You will see the configuration about sound card and ...

  5. 进监狱全攻略之 Mifare1 Card 破解

    补充新闻:程序员黑餐馆系统 给自己饭卡里充钱 ,技术是双刃剑,小心,小心! 前言 从M1卡的验证漏洞被发现到现今,破解设备层出不穷,所以快速傻瓜式一键破解不是本文的重点,年轻司机将从本文中获得如下技能 ...

  6. Card(bestcoder #26 B)

    Card Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submi ...

  7. [OpenJudge 3061]Flip The Card

    [OpenJudge 3061]Flip The Card 试题描述 There are N× Ncards, which form an N× Nmatrix. The cards can be p ...

  8. [杂谈]交通工具orca card

    How and Where to Use the ORCA Card The Microsoft ORCA card provides unlimited rides on all buses, tr ...

  9. [OrangePi] Backup internal EMMC to SD Card

    Boot your Orange PI board from EMMC without SD Card inserted login insert your SD Card Run: sudo ins ...

随机推荐

  1. 利用console控制台调试php代码

    /** * 控制台输出 * @param $var * @param string $level */ public function console($var,$level = 'debug') { ...

  2. bzoj 1046 : [HAOI2007]上升序列 dp

    题目链接 1046: [HAOI2007]上升序列 Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 3620  Solved: 1236[Submit] ...

  3. linux下挂载第二块硬盘

    1.第一步:添加硬盘/新建分区(fdisk) a.查看当前系统所有硬盘及分区情况:fdisk -lb.在指定的硬盘(例:/dev/sda)上创建分区:fdisk /dev/sda , 根据提示进行下一 ...

  4. 1TB到底能存放多少东西?

    网盘大战逐渐升级,360和百度网盘先后推出的1TB网盘存储,而腾讯甚至为其微云网盘打出10TB的招牌来哄抢用户. 这里我们聊聊1TB的网盘究竟能放多少东西? 以下是我在网上找到的一些资料. 一)30年 ...

  5. 求1+2+...+n

    题目:求1+2+…+n,要求不能使用乘除法.for.while.if.else.switch.case等关键字以及条件判断语句(A?B:C). 程序很简单,就看想到想不到了.悲剧,我属于后者... 算 ...

  6. Hope

    透过希望的窗棂,在阴霾的罅隙里也可以寻找阳光,看到未来的春暖花开. ——forever97

  7. srm 534

    250 Description 给你一个1*n的棋盘.两人轮流行动,每一个人能够把"o"向右移动到空格子.或者跨越连续两个"o"到空格子. 一个"o& ...

  8. Android Material Design-Creating Apps with Material Design(用 Material Design设计App)-(零)

    转载请注明出处:http://blog.csdn.net/bbld_/article/details/40400031 翻译自:http://developer.android.com/trainin ...

  9. CSS3线性渐变linear-gradient

    转自 http://www.w3cplus.com/content/css3-gradient CSS3的线性渐变 一.线性渐变在Mozilla下的应用 -moz-linear-gradient( [ ...

  10. lightOJ 1047 Neighbor House (DP)

    lightOJ 1047   Neighbor House (DP) 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87730# ...