PAT (Advanced Level) Practice 1027 Colors in Mars (20 分) 凌宸1642 题目描述: People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for R…
PAT (Advanced Level) Practice 1019 General Palindromic Number (20 分) 凌宸1642 题目描述: A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All single digit…
PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) 凌宸1642 题目描述: With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup tro…
PAT (Advanced Level) Practice 1005 Spell It Right (20 分) 凌宸1642 题目描述: 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. 译:给出一个非负整数 N , 你的任务是计算出 N 的每位数的和,并且用英语输出和的每一位数…
PAT (Advanced Level) Practice 1001 A+B Format (20 分) 凌宸1642 题目描述: 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). 译:计算 a + b 的和,并格式化…
本题要求实现一种数字加密方法.首先固定一个加密用正整数 A,对任一正整数 B,将其每 1 位数字与 A 的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对 13 取余——这里用 J 代表 10.Q 代表 11.K 代表 12:对偶数位,用 B 的数字减去 A 的数字,若结果为负数,则再加 10.这里令个位为第 1 位. 输入格式: 输入在一行中依次给出 A 和 B,均为不超过 100 位的正整数,其间以空格分隔. 输出格式: 在一行中输出加密后的结果. 输入样例: 1234567 3…
本题要求实现一种数字加密方法.首先固定一个加密用正整数 A,对任一正整数 B,将其每 1 位数字与 A 的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对 13 取余——这里用 J 代表 10.Q 代表 11.K 代表 12:对偶数位,用 B 的数字减去 A 的数字,若结果为负数,则再加 10.这里令个位为第 1 位. 输入格式: 输入在一行中依次给出 A 和 B,均为不超过 100 位的正整数,其间以空格分隔. 输出格式: 在一行中输出加密后的结果. 输入样例: 1234567 3…
本题要求实现一种数字加密方法.首先固定一个加密用正整数 A,对任一正整数 B,将其每 1 位数字与 A 的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对 13 取余--这里用 J 代表 10.Q 代表 11.K 代表 12:对偶数位,用 B 的数字减去 A 的数字,若结果为负数,则再加 10.这里令个位为第 1 位. 输入格式: 输入在一行中依次给出 A 和 B,均为不超过 100 位的正整数,其间以空格分隔. 输出格式: 在一行中输出加密后的结果. 输入样例: 1234567 3…
旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现.现在给出应该输入的一段文字.以及实际被输入的文字,请你列出肯定坏掉的那些键. 输入格式: 输入在 2 行中分别给出应该输入的文字.以及实际被输入的文字.每段文字是不超过 80 个字符的串,由字母 A-Z(包括大.小写).数字 0-9.以及下划线 _(代表空格)组成.题目保证 2 个字符串均非空. 输出格式: 按照发现顺序,在一行中输出坏掉的键.其中英文字母只输出大写,每个坏键只输出一次.题目保证至少有 1 个坏键. 输入样例: 7…
令 Pi​ 表示第 i 个素数.现任给两个正整数 M≤N≤104,请输出 PM​ 到 PN​ 的所有素数. 输入格式: 输入在一行中给出 M 和 N,其间以空格分隔. 输出格式: 输出从 PM​ 到 PN​ 的所有素数,每 10 个数字占 1 行,其间以空格分隔,但行末不得有多余空格. 输入样例: 5 27   输出样例: 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103   代码长度限制 16 KB 时…