PAT甲级
文章平均质量分 55
PAT甲级
D.ziyu
今天,你变得更博学了吗?
展开
-
1076 Forwards on Weibo
算是我做的第一道30分题目吧。原创 2022-03-18 17:25:06 · 283 阅读 · 0 评论 -
1043 Is It a Binary Search Tree
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 with keys less than the node’s key. The right subtree of a node contains only nodes with keys greater than原创 2022-03-15 15:12:07 · 422 阅读 · 0 评论 -
1020 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 output the level order traversal sequence of the corresponding binary tree. Input Specification: Each input原创 2022-03-13 19:46:42 · 226 阅读 · 0 评论 -
1025 PAT Ranking (25分)
题目 学到的东西 代码 #include <iostream> #include <string> #include <algorithm> using namespace std; struct Student{ string id; //准考证 int score; //分数 int location_number;//考场号 int local_rank; //考场内排名 int total_rank; //总排名 }stu[300原创 2021-01-13 14:55:48 · 86 阅读 · 0 评论 -
1002 A+B for Polynomials (25分)
题目 可以理解为输入两个多项式,求和 输入 2 1 2.4 0 3.2 2 2 1.5 1 0.5 第一行为 k = 2,x1 = 2.4,x0 = 3.2 第二行为 k = 2,x2 = 1.5,x1 = 0.5 想法 输入的N1,N2就是数组的下标,小数就是数组内的值,弄两个数组(或是二维数组),结果加起来按格式输出就好了 代码 #include<iostream> using namespace std; int main(){ float a[2][10000];原创 2021-01-08 11:12:52 · 142 阅读 · 0 评论 -
1001 A+B Format (20分)中的(i + 1) % 3 == len % 3 && i != len - 1
if ((i + 1) % 3 == len % 3 && i != len - 1) (i + 1) % 3 == len % 3 右边代表第几个数字后面应该加“,” 左边代表,3个数字为循环,这是第几个数字原创 2021-01-08 10:06:04 · 277 阅读 · 0 评论