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. poj2032Square Carpets(IDA* + dancing links)

    题目请戳这里 题目大意:给一个H行W列的01矩阵,求最少用多少个正方形框住所有的1. 题目分析:又是一个红果果的重复覆盖模型.DLX搞之! 枚举矩阵所有的子正方形,全1的话建图.判断全1的时候,用了一 ...

  2. PowerShell Remove all user defined variable in PowerShell

    When PS scripts executes, it is possibly create much user defined variables. So, sometimes these var ...

  3. bootstrap读书笔记

    引入bootstrap.js或单个插件的js文件 若引入单个插件的js文件,注意插件之间的依赖关系 data属性api data属性的api很方便,但我们也可以选择关闭这个功能:$(document) ...

  4. 射频识别技术漫谈(21)——RC系列射频芯片的天线设计

    个人感觉使用RC系列射频芯片开发卡片读写器,主要的关键点有两个,分别涉及硬件和软件.软件上的关键是如何正确设置RC系列射频芯片内部的64个寄存器,硬件上的关键则是RC系列射频芯片的天线设计.天线提供了 ...

  5. 找到了解决Elite多媒体键失效的问题

    首先抛弃itouch这个东西,google了一下,官方没有解决方案. 其次就是找第三方软件把这些快捷键重新定义,同样google了一下,发现了一个叫做hot keyboard的东西,试验了一下,可以识 ...

  6. Windows Azure 即将更名

     今天我们宣布自2014 年4 月3 日起,WindowsAzure 将更名为Microsoft Azure.这一更名反映了Microsoft 的战略,并显示了Microsoft 专注于将Azur ...

  7. JS动态增加页面上的控件实例

    <input   type="button"   value="继续添加"   onclick="append();"/ > & ...

  8. C++使用之常量的定义

    在介绍C++的常前,先看下下面的代码. for (int i = 0; i < 512; ++i) { …; } 512是什么,它具有什么含义?在代码中若直接使用类似512这些“魔数”(magi ...

  9. C#后台发送HTTP请求

    using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using Syst ...

  10. memcache学习使用

    一.安装 二.telnet测试 启动:memcached -d -m 120.24.242.100 -p 11211 -u root 测试:telnet localhost 11211 >> ...