![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
题解
文章平均质量分 87
刷题过程记录
Hcosyv
这个作者很懒,什么都没留下…
展开
-
PAT甲级_字符串
A1005 Spell It Right (20 分)原题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 case occupies one line wh原创 2021-02-17 14:15:12 · 760 阅读 · 0 评论 -
PAT_甲级 简单模拟
一、原题At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in’s and out’s, you are supposed to find the ones who have unlocked an原创 2021-02-15 22:12:17 · 191 阅读 · 0 评论 -
A1001 A+B Format (20) 字符串处理
A+B格式计算a+b并以标准格式输出和。标准格式为:数字每三个一组要用逗号分开(除非少于四个数字)重点是将计算结果转换为字符串,然后处理字符串,以满足标准格式。可以使用cpp11的to_string(有头文件)错误记录第一次想用for循环处理数组,通过计数器判断是否输出逗号,但是问题在于字符串顺序和要判断的顺序是反的。不过处理了负数的负号问题。第二次从尾部开始处理,但是输出的顺序和标准顺序是反的第三次想法是从尾部开始处理,处理结果放在另一个string里,输出再从尾开始,相对麻烦注意到.原创 2021-01-12 20:54:22 · 227 阅读 · 0 评论