![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
Oliver_H_
这个作者很懒,什么都没留下…
展开
-
1001 A+B Format(字符串+to_string)
Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Specification: Each input fil...原创 2019-08-02 22:59:50 · 130 阅读 · 0 评论 -
1050 String Subtraction(字符串+getline)
Given two strings S1 and S2, S=S1−S2 is defined to be the remaining string after taking all the characters in S2 from S1 Your task is simply to calculate S1−S2 for any given strings. However, it mi...原创 2019-08-13 13:41:34 · 136 阅读 · 0 评论 -
1061 Dating(cctype)
Sherlock Holmes received a note with some strange strings: Let’s date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minute to figure out that those strange strings...原创 2019-08-13 19:47:34 · 136 阅读 · 0 评论 -
1069 The Black Hole of Numbers(字符串的处理!最重要字符串题之一!)
For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order, a new number can be obtained by takin...原创 2019-08-14 20:11:14 · 95 阅读 · 0 评论 -
1035 Password(字符串+vector代替结构体)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L ...原创 2019-08-11 20:45:02 · 78 阅读 · 0 评论 -
1073 Scientific Notation(字符串下标和字符个数的问题,多思考几次,不要乱)
Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [±][1-9].[0-9]+E[±][0-9]+ which means that the intege...原创 2019-08-15 20:07:01 · 125 阅读 · 0 评论 -
1071 Speech Patterns(map+cctype+auto)
People often have a preference among synonyms of the same word. For example, some may prefer “the police”, while others may prefer “the cops”. Analyzing such patterns can help to narrow down a speaker...原创 2019-08-31 14:41:47 · 80 阅读 · 0 评论 -
1084 Broken Keyboard(字符串+find)
On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen. Now given a string that you are supposed to ...原创 2019-08-31 17:16:06 · 86 阅读 · 0 评论 -
1086 Tree Traversals Again(数的遍历+栈+字符串数字混合输入)
An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is traversed, the stac...原创 2019-09-02 13:50:19 · 111 阅读 · 0 评论 -
1052 卖个萌(二维vector+字符串处理)
萌萌哒表情符号通常由“手”、“眼”、“口”三个主要部分组成。简单起见,我们假设一个表情符号是按下列格式输出的: 左手[右手] 现给出可选用的符号集合,请你按用户的要求输出表情。 输入格式: 输入首先在前三行顺序对应给出手、眼、口的可选符号集。每个符号括在一对方括号 []内。题目保证每个集合都至少有一个符号,并不超过 10 个符号;每个符号包含 1 到 4 个非空字符。 之后一行给出一个正整数 K,...原创 2019-08-01 20:00:20 · 170 阅读 · 0 评论 -
1048 数字加密(字符串+append)
本题要求实现一种数字加密方法。首先固定一个加密用正整数 A,对任一正整数 B,将其每 1 位数字与 A 的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对 13 取余——这里用 J 代表 10、Q 代表 11、K 代表 12;对偶数位,用 B 的数字减去 A 的数字,若结果为负数,则再加 10。这里令个位为第 1 位。 输入格式: 输入在一行中依次给出 A 和 B,均为不超过 100 ...原创 2019-07-31 23:21:32 · 305 阅读 · 0 评论 -
1076 Wifi密码(字符串的输入问题)
下面是微博上流传的一张照片:“各位亲爱的同学们,鉴于大家有时需要使用 wifi,又怕耽误亲们的学习,现将 wifi 密码设置为下列数学题答案:A-1;B-2;C-3;D-4;请同学们自己作答,每两日一换。谢谢合作!!~”—— 老师们为了促进学生学习也是拼了…… 本题就要求你写程序把一系列题目的答案按照卷子上给出的对应关系翻译成 wifi 的密码。这里简单假设每道选择题都有 4 个选项,有且只有 1...原创 2019-07-26 22:27:52 · 184 阅读 · 0 评论 -
1081 检查密码(字符串的输入)
本题要求你帮助某网站的用户注册模块写一个密码合法性检查的小功能。该网站要求用户设置的密码必须由不少于6个字符组成,并且只能有英文字母、数字和小数点 .,还必须既有字母也有数字。 输入格式: 输入第一行给出一个正整数 N(≤ 100),随后 N 行,每行给出一个用户设置的密码,为不超过 80 个字符的非空字符串,以回车结束。 输出格式: 对每个用户的密码,在一行中输出系统反馈信息,分以下5种: 如果...原创 2019-07-28 15:57:02 · 226 阅读 · 0 评论 -
1091 N-自守数(字符串)
如果某个数 K 的平方乘以 N 以后,结果的末尾几位数等于 K,那么就称这个数为“N-自守数”。例如 3×92的2次方=25392,而 25392 的末尾两位正好是 92,所以 92 是一个 3-自守数。 本题就请你编写程序判断一个给定的数字是否关于某个 N 是 N-自守数。 输入格式: 输入在第一行中给出正整数 M(≤20),随后一行给出 M 个待检测的、不超过 1000 的正整数。 输出格式...原创 2019-07-28 21:24:04 · 124 阅读 · 0 评论 -
1024 科学计数法(字符串的处理)
科学计数法是科学家用来表示很大或很小的数字的一种方便的方法,其满足正则表达式 [±][1-9].[0-9]+E[±][0-9]+,即数字的整数部分只有 1 位,小数部分至少有 1 位,该数字及其指数部分的正负号即使对正数也必定明确给出。 现以科学计数法的格式给出实数 A,请编写程序按普通数字表示法输出 A,并保证所有有效位都被保留。 输入格式: 每个输入包含 1 个测试用例,即一个以科学计数法表示...原创 2019-07-29 22:08:20 · 431 阅读 · 0 评论 -
1029 旧键盘(字符串)
旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现。现在给出应该输入的一段文字、以及实际被输入的文字,请你列出肯定坏掉的那些键。 输入格式: 输入在 2 行中分别给出应该输入的文字、以及实际被输入的文字。每段文字是不超过 80 个字符的串,由字母 A-Z(包括大、小写)、数字 0-9、以及下划线 _(代表空格)组成。题目保证 2 个字符串均非空。 输出格式: 按照发现顺序,在一行中输...原创 2019-07-31 19:15:18 · 62 阅读 · 0 评论 -
1005 Spell It Right(字符串+to_string)
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file contains one test case. Each ...原创 2019-08-04 23:27:10 · 68 阅读 · 0 评论 -
1033 旧键盘打字(字符串和cin问题)
旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现。现在给出应该输入的一段文字、以及坏掉的那些键,打出的结果文字会是怎样? 输入格式: 输入在 2 行中分别给出坏掉的那些键、以及应该输入的文字。其中对应英文字母的坏键以大写给出;每段文字是不超过 10 5 个字符的串。可用的字符包括字母 [a-z, A-Z]、数字 0-9、以及下划线 _(代表空格)、,、.、-、+(代表上档...原创 2019-07-31 20:32:57 · 84 阅读 · 0 评论 -
1039 到底买不买(字符串+数组;简单题)
小红想买些珠子做一串自己喜欢的珠串。卖珠子的摊主有很多串五颜六色的珠串,但是不肯把任何一串拆散了卖。于是小红要你帮忙判断一下,某串珠子里是否包含了全部自己想要的珠子?如果是,那么告诉她有多少多余的珠子;如果不是,那么告诉她缺了多少珠子。 为方便起见,我们用[0-9]、[a-z]、[A-Z]范围内的字符来表示颜色。例如在图1中,第3串是小红想做的珠串;那么第1串可以买,因为包含了全部她想要的珠子,还...原创 2019-07-31 21:27:08 · 108 阅读 · 0 评论 -
1100 Mars Numbers(字符串+stoi)
People on Mars count their numbers with base 13: Zero on Earth is called “tret” on Mars. The numbers 1 to 12 on Earth is called “jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec” on Mars, re...原创 2019-09-04 10:51:39 · 124 阅读 · 0 评论