
PAT甲级
文章平均质量分 60
逻辑fi
这个作者很懒,什么都没留下…
展开
-
PAT 甲级- 1006 Sign In and Sign Out
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 and loc原创 2024-02-22 09:20:16 · 398 阅读 · 0 评论 -
PAT 甲级-1005 Spell It Right
给你一个int数字,要求你按照位相加得到sum,然后用英文输出每位数字。这是一道字符串处理的题目,用到的知识点如下图。原创 2024-02-21 10:41:35 · 400 阅读 · 0 评论 -
PAT 甲级-1004 Counting Leaves
先采用vector数组来存储非叶子结点的孩子结点,采用dfs的方式进行遍历,遍历过程中更新最大层次数和每层的叶子结点个数。给你一个树,含有N个结点,其中M个结点是非叶子结点,接下来给你这M个结点的孩子结点。要求你输出每层的叶子结点。原创 2024-02-20 21:44:23 · 1452 阅读 · 0 评论 -
PAT甲级-1003 Emergency
题目:As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair of cities are mar原创 2024-02-03 17:22:12 · 905 阅读 · 0 评论 -
PAT甲级-1002 A+B for Polynomials
算法过程:思路较为简单,用一个float数组实现相加,格式化输出的时候用c语言格式化输出就好了。同时这个题也可用map容器来写更优。原创 2024-01-28 22:42:58 · 445 阅读 · 0 评论 -
PTA甲级-1001 A+B Format
算法过程:如果结果位负数,则将先输出负号,之后都按照整数输出,将int型结果借助stringstream转换为string类型,然后输出。题目大意:格式化输出A+B,每隔三位数加一个逗号。原创 2024-01-27 11:43:38 · 386 阅读 · 0 评论