|
|
|
|
|
02 2019 档案
PAT A1110 Complete Binary Tree (25 分)——完全二叉树,字符串转数字
摘要:Given a tree, you are supposed to tell if it is a complete binary tree. Input Specification: Each input file contains one test case. For each case, th
阅读全文
PAT A1109 Group Photo (25 分)——排序
摘要:Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following: The number of people in each
阅读全文
PAT A1108 Finding Average (20 分)——字符串,字符串转数字
摘要:The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input n
阅读全文
PAT A1107 Social Clusters (30 分)——并查集
摘要:When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A socia
阅读全文
PAT A1106 Lowest Price in Supply Chain (25 分)——树的bfs遍历
摘要:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer
阅读全文
PAT A1104 Sum of Number Segments (20 分)——数学规律,long long
摘要:Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we
阅读全文
PAT A1103 Integer Factorization (30 分)——dfs,递归
摘要:The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program t
阅读全文
PAT A1102 Invert a Binary Tree (25 分)——静态树,层序遍历,先序遍历,后序遍历
摘要:The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a
阅读全文
PAT A1096 Consecutive Factors (20 分)——数字遍历
摘要:Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, a
阅读全文
PAT A1098 Insertion or Heap Sort (25 分)——堆排序和插入排序,未完待续。。
摘要:According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insert
阅读全文
PAT A1099 Build A Binary Search Tree (30 分)——二叉搜索树,中序遍历,层序遍历
摘要:A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes
阅读全文
PAT A1097 Deduplication on a Linked List (25 分)——链表
摘要:Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each va
阅读全文
PAT A1115 Counting Nodes in a BST (30 分)——二叉搜索树,层序遍历或者dfs
摘要:A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes
阅读全文
PAT A1113 Integer Set Partition (25 分)——排序题
摘要:Given a set of N (>1) positive integers, you are supposed to partition them into two disjoint sets A1 and A2 of n1 and n2 numbers, respect
阅读全文
PAT A1112 Stucked Keyboard (20 分)——字符串
摘要:On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear rep
阅读全文
PAT A1118 Birds in Forest (25 分)——并查集
摘要:Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are
阅读全文
PAT A1117 Eddington Number (25 分)——数学题
摘要:British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an "Eddington number", E -- tha
阅读全文
PAT A1123 Is It a Complete AVL Tree (30 分)——AVL平衡二叉树,完全二叉树
摘要:An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any
阅读全文
PAT A1122 Hamiltonian Cycle (25 分)——图遍历
摘要:The "Hamilton cycle problem" is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a "Hamiltonian cycle". In this pr
阅读全文
PAT A1121 Damn Single (25 分)——set遍历
摘要:"Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can
阅读全文
PAT A1120 Friend Numbers (20 分)——set
摘要:Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are fri
阅读全文
PAT A1127 ZigZagging on a Tree (30 分)——二叉树,建树,层序遍历
摘要:Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and ino
阅读全文
PAT A1126 Eulerian Path (25 分)——连通图,入度
摘要:In graph theory, an Eulerian path is a path in a graph which visits every edge exactly once. Similarly, an Eulerian circuit is an Eulerian path which
阅读全文
PAT A1124 Raffle for Weibo Followers (20 分)——数学题
摘要:John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from
阅读全文
PAT A1139 First Contact (30 分)——set
摘要:Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a g
阅读全文
PAT A1138 Postorder Traversal (25 分)——大树的遍历
摘要:Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to out
阅读全文
PAT A1137 Final Grading (25 分)——排序
摘要:For a student taking the online course "Data Structures" on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/
阅读全文
PAT A1136 A Delayed Palindrome (20 分)——回文,大整数
摘要:Consider a positive integer N written in standard notation with k+1 digits ai as ak⋯a1a0 with 0≤ai<10 for all i and ak>0. Then N is
阅读全文
PAT A1134 Vertex Cover (25 分)——图遍历
摘要:A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. Now given a graph with
阅读全文
PAT A1133 Splitting A Linked List (25 分)——链表
摘要:Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all
阅读全文
PAT A1132 Cut Integer (20 分)——数学题
摘要:Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 1673
阅读全文
PAT A1130 Infix Expression (25 分)——中序遍历
摘要:Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operat
阅读全文
PAT A1142 Maximal Clique (25 分)——图
摘要:A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. A maximal clique is a clique
阅读全文
PAT A1141 PAT Ranking of Institutions (25 分)——排序,结构体初始化
摘要:After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the rank
阅读全文
PAT A1140 Look-and-say Sequence (20 分)——数学题
摘要:Look-and-say sequence is a sequence of integers as the following: D, D1, D111, D113, D11231, D112213111, ... where D is in [0, 9] except 1. The (n+1)s
阅读全文
PAT A1143 Lowest Common Ancestor (30 分)——二叉搜索树,lca
摘要:The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. A binary search tree (BST) i
阅读全文
PAT A1151 LCA in a Binary Tree (30 分)——二叉树,最小公共祖先(lca)
摘要:The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. Given any two nodes in a bin
阅读全文
PAT A1150 Travelling Salesman Problem (25 分)——图的遍历
摘要:The "travelling salesman problem" asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shor
阅读全文
PAT A1149 Dangerous Goods Packaging (25 分)——set查找
摘要:When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in s
阅读全文
PAT A1148 Werewolf - Simple Version (20 分)——暴力遍历,负负得正
摘要:Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game, player #1
阅读全文
PAT A1129 Recommendation System (25 分)——set,结构体重载小于号
摘要:Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that
阅读全文
PAT A1128 N Queens Puzzle (20 分)——数学题
摘要:The "eight queens puzzle" is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other. Thus, a solutio
阅读全文
PAT A1144 The Missing Number (20 分)——set
摘要:Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list. Input Specification: Each input file contains
阅读全文
PAT A1145 Hashing - Average Search Time (25 分)——hash 散列的平方探查法
摘要:The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of inte
阅读全文
PAT A1146 Topological Order (25 分)——拓扑排序,入度
摘要:This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed grap
阅读全文
PAT A1147 Heaps (30 分)——完全二叉树,层序遍历,后序遍历
摘要:In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the
阅读全文
PAT A1155 Heap Paths (30 分)——完全二叉树,层序遍历,特定dfs遍历
摘要:In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the
阅读全文
PAT A1153 Decode Registration Card of PAT (25 分)——多种情况排序
摘要:A registration card number of PAT consists of 4 parts: the 1st letter represents the test level, namely, T for the top level, A for advance and B for
阅读全文
PAT A1034 Head of a Gang (30 分)——图遍历DFS,字符串和数字的对应保存
摘要:One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call between A and B, we say that A and B is re
阅读全文
PAT A1033 To Fill or Not to Fill (25 分)——贪心
摘要:With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas s
阅读全文
PAT A1029 Median (25 分)——队列
摘要:Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 1
阅读全文
PAT A1028 List Sorting (25 分)——排序,字符串输出用printf
摘要:Excel can sort records according to any column. Now you are supposed to imitate this function. Input Specification: Each input file contains one test
阅读全文
PAT A1026 Table Tennis (30 分)——队列
摘要:A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open
阅读全文
PAT A1024 Palindromic Number (25 分)——回文,大整数
摘要: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
阅读全文
PAT A1021 Deepest Root (25 分)——图的BFS,DFS
摘要:A graph which is connected and acyclic can be considered a tree. The hight of the tree depends on the selected root. Now you are supposed to find the
阅读全文
PAT A1020 Tree Traversals (25 分)——建树,层序遍历
摘要:Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou
阅读全文
PAT A1019 General Palindromic Number (20 分)——回文,进制转换
摘要: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
阅读全文
PAT A1018 Public Bike Management (30 分)——最小路径,溯源,二标尺,DFS
摘要:There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any s
阅读全文
PAT A1017 Queueing at Bank (25 分)——队列
摘要:Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the c
阅读全文
PAT A1016 Phone Bills (25 分)——排序,时序
摘要:A long-distance telephone company charges its customers by the following rules: Making a long-distance call costs a certain amount per minute, dependi
阅读全文
PAT A1015 Reversible Primes (20 分)——进制转换,质数
摘要:A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a re
阅读全文
PAT A1014 Waiting in Line (30 分)——队列
摘要:Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules
阅读全文
PAT A1013 Battle Over Cities (25 分)——图遍历,联通块个数
摘要:It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that c
阅读全文
PAT A1012 The Best Rank (25 分)——多次排序,排名
摘要:To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mat
阅读全文
PAT A1010 Radix (25 分)——进制转换,二分法
摘要:Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a
阅读全文
PAT A1009 Product of Polynomials (25 分)——浮点,结构体数组
摘要:This time, you are supposed to find A×B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occu
阅读全文
PAT A1007 Maximum Subsequence Sum (25 分)——最大子列和,动态规划
摘要:Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj } where 1. The Max
阅读全文
PAT A1004 Counting Leaves (30 分)——树,DFS,BFS
摘要:A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Specification: Each inp
阅读全文
PAT B1050 螺旋矩阵 (25 分)
摘要:本题要求将给定的 N 个正整数按非递增的顺序,填入“螺旋矩阵”。所谓“螺旋矩阵”,是指从左上角第 1 个格子开始,按顺时针螺旋方向填充。要求矩阵的规模为 m 行 n 列,满足条件:m×n 等于 N;m≥n;且 m−n 取所有可能值中的最小值。 输入格式: 输入在第 1 行中给出一个正整数 N,第 2
阅读全文
PAT B1048 数字加密 (20 分)
摘要:本题要求实现一种数字加密方法。首先固定一个加密用正整数 A,对任一正整数 B,将其每 1 位数字与 A 的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对 13 取余——这里用 J 代表 10、Q 代表 11、K 代表 12;对偶数位,用 B 的数字减去 A 的数字,若结果为负数,则再加
阅读全文
PAT B1045 快速排序 (25 分)
摘要:著名的快速排序算法里有一个经典的划分过程:我们通常采用某种方法取一个元素作为主元,通过交换,把比主元小的元素放到它的左边,比主元大的元素放到它的右边。 给定划分后的 N 个互不相同的正整数的排列,请问有多少个元素可能是划分前选取的主元? 例如给定 $N = 5$, 排列是1、3、2、4、5。则: 1
阅读全文
PAT B1042 字符统计 (20 分)
摘要:请编写程序,找出一段给定文字中出现最频繁的那个英文字母。 输入格式: 输入在一行中给出一个长度不超过 1000 的字符串。字符串由 ASCII 码表中任意可见字符及空格组成,至少包含 1 个英文字母,以回车结束(回车不算在内)。 输出格式: 在一行中输出出现频率最高的那个英文字母及其出现次数,其间以
阅读全文
PAT B1040 有几个PAT (25 分)
摘要:字符串 APPAPT 中包含了两个单词 PAT,其中第一个 PAT 是第 2 位(P),第 4 位(A),第 6 位(T);第二个 PAT 是第 3 位(P),第 4 位(A),第 6 位(T)。 现给定字符串,问一共可以形成多少个 PAT? 输入格式: 输入只有一行,包含一个字符串,长度不超过1,
阅读全文
PAT B1035 插入与归并 (25 分)
摘要:根据维基百科的定义: 插入排序是迭代算法,逐一获得输入数据,逐步产生有序的输出序列。每步迭代中,算法从输入序列中取出一元素,将之插入有序序列中正确的位置。如此迭代直到全部元素有序。 归并排序进行如下迭代操作:首先将原始序列看成 N 个只包含 1 个元素的有序子序列,然后每次迭代归并两个相邻的有序子序
阅读全文
PAT B1034 有理数四则运算 (20 分)
摘要:本题要求编写程序,计算 2 个有理数的和、差、积、商。 输入格式: 输入在一行中按照 a1/b1 a2/b2 的格式给出两个分数形式的有理数,其中分子和分母全是整型范围内的整数,负号只可能出现在分子前,分母不为 0。 输出格式: 分别在 4 行中按照 有理数1 运算符 有理数2 = 结果 的格式顺序
阅读全文
PAT B1033 旧键盘打字 (20 分)
摘要:旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现。现在给出应该输入的一段文字、以及坏掉的那些键,打出的结果文字会是怎样? 输入格式: 输入在 2 行中分别给出坏掉的那些键、以及应该输入的文字。其中对应英文字母的坏键以大写给出;每段文字是不超过 1 个字符的串。可用的字符包括字母 [a
阅读全文
PAT B1030 完美数列 (25 分)
摘要:给定一个正整数数列,和正整数 p,设这个数列中的最大值是 M,最小值是 m,如果 M≤mp,则称这个数列是完美数列。 现在给定参数 p 和一些正整数,请你从中选择尽可能多的数构成一个完美数列。 输入格式: 输入第一行给出两个正整数 N 和 p,其中 N(≤)是输入的正整数的个数,p(≤)是给定的参数
阅读全文
PAT B1029 旧键盘 (20 分)
摘要:旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现。现在给出应该输入的一段文字、以及实际被输入的文字,请你列出肯定坏掉的那些键。 输入格式: 输入在 2 行中分别给出应该输入的文字、以及实际被输入的文字。每段文字是不超过 80 个字符的串,由字母 A-Z(包括大、小写)、数字 0-9、
阅读全文
PAT B1027 打印沙漏 (20 分)
摘要:本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印 ***** *** * *** ***** 所谓“沙漏形状”,是指每行输出奇数个符号;各行符号中心对齐;相邻两行符号数差2;符号数先从大到小顺序递减到1,再从小到大顺序递增;首尾符号数相等。 给定任意N个符号,
阅读全文
PAT B1025 反转链表 (25 分)
摘要:给定一个常数 K 以及一个单链表 L,请编写程序将 L 中每 K 个结点反转。例如:给定 L 为 1→2→3→4→5→6,K 为 3,则输出应该为 3→2→1→6→5→4;如果 K 为 4,则输出应该为 4→3→2→1→5→6,即最后不到 K 个元素不反转。 输入格式: 每个输入包含 1 个测试用例
阅读全文
PAT B1022 D进制的A+B (20 分)
摘要:输入两个非负 10 进制整数 A 和 B (≤),输出 A+B 的 D (1)进制数。 输入格式: 输入在一行中依次给出 3 个整数 A、B 和 D。 输出格式: 输出 A+B 的 D 进制数。 输入样例: 输出样例: 注意点:一个整数的D进制就是他不断取余,整除的过程,叫除基取余法。一个P进制转换
阅读全文
PAT B1018 锤子剪刀布 (20 分)
摘要:大家应该都会玩“锤子剪刀布”的游戏:两人同时给出手势,胜负规则如图所示: 现给出两人的交锋记录,请统计双方的胜、平、负次数,并且给出双方分别出什么手势的胜算最大。 输入格式: 输入第 1 行给出正整数 N(≤),即双方交锋的次数。随后 N 行,每行给出一次交锋的信息,即甲、乙双方同时给出的的手势。C
阅读全文
PAT B1017 A除以B (20 分)
摘要:本题要求计算 /,其中 A 是不超过 1000 位的正整数,B 是 1 位正整数。你需要输出商数 Q 和余数 R,使得 A=B×Q+R成立。 输入格式: 输入在一行中依次给出 A 和 B,中间以 1 空格分隔。 输出格式: 在一行中依次输出 Q 和 R,中间以 1 空格分隔。 输入样例: 输出样例:
阅读全文
PAT B1015 德才论 (25 分)
摘要:宋代史学家司马光在《资治通鉴》中有一段著名的“德才论”:“是故才德全尽谓之圣人,才德兼亡谓之愚人,德胜才谓之君子,才胜德谓之小人。凡取人之术,苟不得圣人,君子而与之,与其得小人,不若得愚人。” 现给出一批考生的德才分数,请根据司马光的理论给出录取排名。 输入格式: 输入第一行给出 3 个正整数,分别
阅读全文
PAT B1013 数素数 (20 分)
摘要:令 Pi 表示第 i 个素数。现任给两个正整数 M≤N≤104,请输出 PM 到 PN 的所有素数。 输入格式: 输入在一行中给出 M 和 N,其间以空格分隔。 输出格式: 输出从 PM 到 PN 的所有素数,每 10 个数字占 1 行,其间以空格分隔,但行末不得
阅读全文
PAT B1010 一元多项式求导 (25 分)
摘要:设计函数求一元多项式的导数。(注:xn(n为整数)的一阶导数为nxn−1。) 输入格式: 以指数递降方式输入多项式非零项系数和指数(绝对值均为不超过 1000 的整数)。数字间以空格分隔。 输出格式: 以与输入相同的格式输出导数多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余
阅读全文
PAT B1008 数组元素循环右移问题 (20 分)
摘要:一个数组A中存有N(>)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(≥)个位置,即将A中的数据由(A0A1⋯AN−1)变换为(AN−M⋯AN−1A0A1⋯AN−M−1)(最后M个数循环移至最前面的M个位置)。如果需要考虑程序移动数据的
阅读全文
PAT B1007 素数对猜想 (20 分)
摘要:让我们定义dn为:dn=pn+1−pn,其中pi是第i个素数。显然有d1=1,且对于n>1有dn是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。 现给定任意正整数N(<),请计算不超过N的满足猜想的素数对的个数。 输入格式: 输入在一行给出正整
阅读全文
PAT B1006 换个格式输出整数 (15 分)
摘要:让我们用字母 B 来表示“百”、字母 S 表示“十”,用 12...n 来表示不为零的个位数字 n(<),换个格式来输出任一个不超过 3 位的正整数。例如 234 应该被输出为 BBSSS1234,因为它有 2 个“百”、3 个“十”、以及个位的 4。 输入格式: 每个测试输入包含 1 个测试用例,
阅读全文
PAT B1005 继续(3n+1)猜想 (25 分)
摘要:卡拉兹(Callatz)猜想已经在1001中给出了描述。在这个题目里,情况稍微有些复杂。 当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数。例如对 n=3 进行验证的时候,我们需要计算 3、5、8、4、2、1,则当我们对 n=5、8、4、2 进行验证的时候,就可以直接
阅读全文
PAT B1003 我要通过!
摘要:“答案正确”是自动判题系统给出的最令人欢喜的回复。本题属于PAT的“答案正确”大派送 —— 只要读入的字符串满足下列条件,系统就输出“答案正确”,否则输出“答案错误”。 得到“答案正确”的条件是: 1. 字符串中必须仅有P, A, T这三种字符,不可以包含其它字符;2. 任意形如 xPATx 的字符
阅读全文
PAT B1002 写出这个数
摘要:读入一个自然数n,计算其各位数字之和,用汉语拼音写出和的每一位数字。 输入格式:每个测试输入包含1个测试用例,即给出自然数n的值。这里保证n小于10100。 输出格式:在一行内输出n的各位数字之和的每一位,拼音数字间有1 空格,但一行中最后一个拼音数字后没有空格。 输入样例: 12345678909
阅读全文
|
|