Identity Card(hdu2629)
输入方式:先输入一个整型,再输入不带空格未知长度/已知长度的字符串。
思考:用scanf_s()函数输入整型,再循环输入不带空格未知长度的字符串,用gets_s()函数。
注意:scanf_s()函数要多加一个%c.&d,来避免对gets_s函数输入字符串的影响。
#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
int n;
char d;
scanf("%d%c", &n, &d);
while (n--)
{
char a[];
gets_s(a);
printf("He/She is from ");
if (a[] == ''&&a[] == '')
printf("Zhejiang,");
else if (a[] == ''&&a[] == '')
printf("Beijing,");
else if (a[] == ''&&a[] == '')
printf("Taiwan,");
else if (a[] == ''&&a[] == '')
printf("Hong Kong,");
else if (a[] == ''&&a[] == '')
printf("Macao,");
else if (a[] == ''&&a[] == '')
printf("Tibet,");
else if (a[] == ''&&a[] == '')
printf("Liaoning,");
else if (a[] == ''&&a[] == '')
printf("Shanghai,");
printf("and his/her birthday is on ");
printf("%c%c,%c%c,%c%c%c%c", a[], a[], a[], a[], a[], a[], a[], a[]);
printf(" based on the table.\n");
}
}
Identity Card(hdu2629)的更多相关文章
- HDU2629:Identity Card
Problem Description Do you own an ID card?You must have a identity card number in your family's Hous ...
- Identity Card(水题)
Identity Card Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) To ...
- hdu 2629 Identity Card (字符串解析模拟题)
这题是一个字符串模拟水题,给12级学弟学妹们找找自信的,嘿嘿; 题目意思就是要你讲身份证的上的省份和生日解析出来输出就可以了: http://acm.hdu.edu.cn/showproblem.ph ...
- HDU 2629 Identity Card
简单题 给出身份证号 判断住址 和出生年月 熟练字符串的操作 主要是string::substr(s, l)//s:起始位置 l长度 #include <iostream> #includ ...
- 杭电2629 Identity Card
题目意思很简单,就是根据身份证号码来确定一个人的籍贯和生日,(然而我开始脑子抽了还以为还要根据奇数偶数判断男女233333). 然后我的暴力ac代码: #include <iostream> ...
- hdu2629Identity Card
Problem Description Do you own an ID card?You must have a identity card number in your family's Hous ...
- startssl
Validation Success You have successfully authenticated domain "xxx.com.cn".You will be abl ...
- Dwarves (有向图判环)
Dwarves 时间限制: 1 Sec 内存限制: 64 MB提交: 14 解决: 4[提交][状态][讨论版] 题目描述 Once upon a time, there arose a huge ...
- ORM框架Hibernate (四) 一对一单向、双向关联映射
简介 在上一篇博客说了一下多对一映射,这里再说一下一对一关联映射,这种例子在生活中很常见,比如一个人的信息和他的身份证是一对一.又如一夫一妻制等等. 记得在Java编程思想上第一句话是“一切皆对象”, ...
随机推荐
- javaScript常用到的方法
判断一个对象是否为空对象,不为null,仅仅是{};可以使用如下方法判断: if (JSON.stringify(object) === '{}') { //.. } //也可以 if (Object ...
- Nginx访问日志.Nginx日志切割
11月27日任务 12.10 Nginx访问日志12.11 Nginx日志切割12.12 静态文件不记录日志和过期时间 1.Nginx访问日志 示例一: 日志格式 vim /usr/local/ngi ...
- HDU Problem D [ Humble number ]——基础DP丑数序列
Problem D Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submi ...
- CF1288C-Two Arrays (DP)
You are given two integers n and m. Calculate the number of pairs of arrays (a,b) such that: the len ...
- CF--思维练习--CodeForces - 220C Little Elephant and Shifts (STL模拟)
ACM思维题训练集合 The Little Elephant has two permutations a and b of length n, consisting of numbers from ...
- ansible roles 自动化安装
例: ansible roles 自动化安装memcached 文件目录结构如下: cat memcached_role.yml - hosts: memcached remote_user: ro ...
- Linux中的程序和进程,PID和PPID
环境:Vmware Workstation:CentOS-6.4-x86_64 程序和进程: 1.程序:程序是静止的,程序就是磁盘上的一个文件. 2.进程:进程是一个正在执行的程序的实例. 3.进程是 ...
- Linux之《荒岛余生》(一)准备篇
xin片之争,已经暴露了中国xin的问题,我等码农束手无策:而在操作系统方面,成果也是乏善可陈:现如今酷炫的Web监控工具,让很多研发丧失了真正处理问题的能力. 越接近底层,就越接近真相,在计算机的世 ...
- SpringData Redis的简单使用
SpringDate Redis是在Jedis框架的基础之上对Redis进行了高度封装,通过简单的属性配置就可以通过调用方法完成对Redis数据库的操作,而且SpringData Redis使用了连接 ...
- ASP.NET Core Blazor 初探之 Blazor WebAssembly
最近Blazor热度很高,传说马上就要发布正式版了,做为微软脑残粉,赶紧也来凑个热闹,学习一下. Blazor Blazor是微软在ASP.NET Core框架下开发的一种全新的Web开发框架.Bla ...