Identity Card

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2696    Accepted Submission(s): 1048

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.
 
Author
Samuel
 

水题:给你身份证号让你找信息;注意string不能用scanf输入。。。

代码:

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<string>
using namespace std;
const int INF=0x3f3f3f3f;
const double PI=acos(-1.0);
#define mem(x,y) memset(x,y,sizeof(x))
#define SI(x) scanf("%d",&x)
#define SL(x) scanf("%lld",&x)
#define PI(x) printf("%d",x)
#define PL(x) printf("%lld",x)
#define P_ printf(" ")
#define T_T while(T--)
typedef long long LL;
map<string,string>mp;
int main(){
int T,y,m,d;
string s;
SI(T);
mp["33"]="Zhejiang";
mp["11"]="Beijing";
mp["71"]="Taiwan";
mp["81"]="Hong Kong";
mp["82"]="Macao";
mp["54"]="Tibet";
mp["21"]="Liaoning";
mp["31"]="Shanghai";
T_T{
//scanf("%s",s.c_str());
cin>>s;
printf("He/She is from %s,and his/her birthday is on %s,%s,%s based on the table.\n",mp[s.substr(0,2)].c_str(),s.substr(10,2).c_str(),s.substr(12,2).c_str(),s.substr(6,4).c_str());
//cout<<"He/She is from "<<mp[s.substr(0,2)]<<",and his/her birthday is on "<<s.substr(10,2)<<","<<s.substr(12,2)<<","<<s.substr(6,4)<<" based on the table."<<endl;
}
return 0;
}

  

Identity Card(水题)的更多相关文章

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

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

  2. poj 1003:Hangover(水题,数学模拟)

    Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 99450   Accepted: 48213 Descri ...

  3. HDU 4772 Zhuge Liang's Password (2013杭州1003题,水题)

    Zhuge Liang's Password Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/O ...

  4. HDOJ 2317. Nasty Hacks 模拟水题

    Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tota ...

  5. ACM :漫漫上学路 -DP -水题

    CSU 1772 漫漫上学路 Time Limit: 1000MS   Memory Limit: 131072KB   64bit IO Format: %lld & %llu Submit ...

  6. ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)

    1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 154  Solved: 112[ ...

  7. [poj2247] Humble Numbers (DP水题)

    DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ...

  8. gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,

    1195: 相信我这是水题 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 821  Solved: 219 Description GDUT中有个风云人 ...

  9. BZOJ 1303 CQOI2009 中位数图 水题

    1303: [CQOI2009]中位数图 Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 2340  Solved: 1464[Submit][Statu ...

随机推荐

  1. 《javascript dom编程艺术》笔记(二)——美术馆示例

    这几天把这本书看完了,里面大部分知识我已经会了,所以看得就略简单,好多地方都没有再去动手去做,我知道这样是不对的,以后补吧. 现在我要做的是把这本书的笔记完结掉,不然总觉得有啥事没有做. 这个版本不是 ...

  2. CSS自学笔记(3):CSS选择器

    CSS中提供了非常丰富的选择器,但是由于浏览器的支持情况,很多选择器很少用到. 1.基础选择器 选择器 含义 示例 * 通用元素选择器,匹配任何元素 * { margin:0; padding:0; ...

  3. 中标麒麟6.0_ICE3.4.2编译+demo测试(CPP)

    (菜鸟版)确保 gcc版本4.4.6(其他版本未测试),4.8不行 一.降级GCC到4.4.6 注意:gcc g++ c++命令都为4.4.6(可用gcc -v; g++ -v; c++ -v 命令查 ...

  4. MySQL----cluster安装

    第一步.下载MySQL cluster: http://cdn.mysql.com/Downloads/MySQL-Cluster-7.4/mysql-cluster-gpl-7.4.7-linux- ...

  5. SQL Server 行的删除与修改-------------(未完待续P222 deep SQL Server 222 )

    删除: 1.堆表:当行被删除时,不会自动重新组织页面上的空间.删除行时不会从物理页面上删除, 而只是把行偏移设置为 0 .表示空间没有使用.除了页面上没有被回收空间之外,堆中的 空白页也常常不会被回收 ...

  6. Android 使用Jsoup解析Html

    想要做一个看新闻的应用,类似Cnbeta客户端的东西.大致思路如下:根据链接获取新闻列表页的html代码,然后解析,找到所有的新闻标题和新闻链接用listView显示,当点击ListView的Item ...

  7. 关于iOS7越狱的整理

    目前越狱非常的不稳定,已经白苹果第三次了.中途遇见了不少问题,去各大论坛找了下解决办法,算是搬运工. iOS7越狱过程中打开手机上的“evasi0n7”闪退,怎么办?1. 请先尝试卸载手机“evasi ...

  8. poj2350

    #include <stdio.h> #include <stdlib.h> int main() { ],tim,i; scanf("%d",&n ...

  9. asp.net 使用my97 datepicker实现前后两个日期的范围界定

    说明:日期选择后,前面的日期小于等后面的日期,后面的日期大于等于前面的日期.点点看就知道了:) - 这里将周末日期不可选.代码如下: <html xmlns="http://www.w ...

  10. 算法精解(C语言描述) 第4章 读书笔记

    第4章 算法分析 1.最坏情况分析 评判算法性能的三种情况:最佳情况.平均情况.最坏情况. 为何要做最坏情况分析: 2.O表示法 需关注当算法处理的数据量变得无穷大时,算法性能将趋近一个什么样的值.一 ...