PAT
just_a_unicorn
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
PAT 1136 stoi产生的错误
写这道题时都使用了现成的函数,stoi(),to_string()等,但是这样一直有两个测试点显示运行时错误。最后排查出发现是stoi这个函数(to_string没测估计也有问题),基本上是因为题目中说过最大数据为1000位,所以这个函数就出错了。只适用于较小的数据吧。代码:#include<iostream>#include<stdio.h>#include<...原创 2020-03-14 10:49:11 · 440 阅读 · 0 评论 -
PAT 1022
提交以后错了最后两个测试点:更改后发现最后两组数据的id小于7位数,或者有前导0,所以输出的时候要按照“%07d"格式。也接着上一题学到的stringstream成功分割了keyword中的字符串,简洁了很多在这里插入代码片#include<iostream>#include<stdio.h>#include<stdlib.h>#include<...原创 2020-03-01 21:29:57 · 207 阅读 · 0 评论 -
PAT 1071
PAT 1071错误点:没有处理最后一个单词。在对整行字符串处理时,如果最后一个单词为有效字符,那么就没有对他放入map操作而是直接结束放入map的所有过程开始遍历找最大了。所以需要在while结束后对最后一个单词进行补充处理。#include<iostream>#include<stdio.h>#include<stdlib.h>#include&l...原创 2020-03-01 18:37:50 · 200 阅读 · 0 评论 -
PAT 甲级 A1098
主要讲错误点:算法笔记给出的一组用例:43 4 2 13 4 2 1//ouputInsertion Sort2 3 4 1可以用来检查自己的匹配插入排序的函数是否正确。有没有正确的处理初始序列和中间序列一致的情况。代码如下:#include<iostream>#include<stdio.h>#include<stdlib.h>#i...原创 2020-02-07 15:54:22 · 243 阅读 · 0 评论 -
PAT_1001
1001. A+B Format (20)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).InputEach in...原创 2018-03-27 03:29:13 · 185 阅读 · 0 评论 -
PAT_1002
1002. A+B for Polynomials (25)This time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case. Each case occupies 2 lines, and each line contains ...原创 2018-03-28 10:39:56 · 217 阅读 · 0 评论 -
PAT_1003
PAT_1003 EmergencyAs 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 ...原创 2018-04-03 23:36:11 · 137 阅读 · 0 评论
分享