hdu2629Identity Card

时间:2022-04-04 12:57:10
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.


hdu2629Identity Card

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],"*");
strcpy(mp[21],"Liaoning");
strcpy(mp[81],"*");
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 &num;26 B&rpar;

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

  7. &lbrack;OpenJudge 3061&rsqb;Flip The Card

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

  8. &lbrack;杂谈&rsqb;交通工具orca card

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

  9. &lbrack;OrangePi&rsqb; 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. 2016年最佳Linux发行版排行榜

    2015年,不管在企业市场还是个人消费市场都是 Linux 非常重要的一年. 最好的回归发行版:openSUSE openSUSE 背后的 SUSE 公司是最老的 Linux 企业,它成立于 Linu ...

  2. vijosP1413 Valentine’s Present

    vijosP1413 Valentine’s Present 链接:https://vijos.org/p/1413 [思路] 组合公式. 由题目知:每个箱子中的蛋糕要么与箱子颜色相同,要么指向一个蛋 ...

  3. native跟volatile

    native是告知编译器 该方法是其他语言实现的 比如C 呵呵 private native void CoutSea();没有方法实现部分的 volatile是Java语言的关键字,用在变量的声明中 ...

  4. 加快maven中jar包的下载速度

    maven下载jar包的默认仓库是http://my.repository.com/repo/path速度较慢,通过配置国内镜像提高下载速度 1.打开eclipse--->Window---&g ...

  5. 监听 window&period;open 打开的窗口关闭并回调

    第三方的登录的解决方案通常有两种方式,一是打开一个新的标签页,然后登录回调回来: 二是通过父窗口打开一个子窗体去第三方登录,登陆成功时关掉子窗体回到父窗口. 问题来了 我的父窗体怎么样才知道子窗体被关 ...

  6. zTree实现更新根节点中第i个节点的名称

    zTree实现更新根节点中第i个节点的名称 1.实现源码 <!DOCTYPE html> <html> <head> <title>zTree实现基本树 ...

  7. sql去除重复列(行)

    1.存在两条完全相同的纪录   这是最简单的一种情况,用关键字distinct就可以去掉   例子: select distinct * from table(表名) where (条件)   2.存 ...

  8. http&colon;&sol;&sol;ctf&period;bugku&period;com&sol;challenges&num;&percnt;E9&percnt;80&percnt;86&percnt;E5&percnt;90&percnt;91&percnt;E5&percnt;85&percnt;A5&percnt;E9&percnt;97&percnt;A8&colon;bugku--逆向入门

      文件是:   分析挺简单,主要是data urls知识点.     首先使用peid检测是否加壳,发现它居然是jpg文件.使用notepad++查看,结果如下.   嗯,百度一下子,知道了data ...

  9. Linux学习笔记之十————Linux常用服务器构建之ftp服务器

    p服务器介绍 FTP 是File Transfer Protocol(文件传输协议)的英文简称,而中文简称为“文传协议”. 用于Internet上的控制文件的双向传输. 同时,它也是一个应用程序(Ap ...

  10. 全球首款完全开源的堡垒机,符合 4A 的专业运维审计系统Jumpserver

    Jumpserver是全球首款完全开源的堡垒机,是符合 4A 的专业运维审计系统. http://www.jumpserver.org https://github.com/jumpserver/ju ...