臭咸鱼的缺氧瓶

快给我氧气!


  • Home

  • Tags

  • Categories

  • Archives

  • Search

PAT乙级1012

Posted on 2019-08-04 | | Visitors:
Words count in article: 375 字 | Reading time ≈ 2 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805311146147840 题解就比较简单,判断每个数字是哪种情况,然后进行相应的计算即可。 下面的代码中其实数组是不必要的,每取一个数字就可以直接进行相应计算。 ...
Read more »

PAT乙级1011

Posted on 2019-08-04 | | Visitors:
Words count in article: 182 字 | Reading time ≈ 1 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805312417021952 题解很明显这题是考数值范围的,int占4个字节,范围正好是$ [−2^{31},2^{31}]$。 两个大的int相加会溢出,而long ...
Read more »

PAT乙级1010

Posted on 2019-08-04 | | Visitors:
Words count in article: 447 字 | Reading time ≈ 2 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805313708867584 我有点看不懂题目……,在网上找题解后,经测试推导题意发现: 如果输入的式子(一项或多项均可)中的常数是0时,输入是应该有0 0的。 而 ...
Read more »

PAT乙级1009

Posted on 2019-08-04 | | Visitors:
Words count in article: 418 字 | Reading time ≈ 2 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805316250615808 题解一我的方法如下: 将这一行字符串格式看做:第一个单词( 单词)( 单词)( 单词) 利用循环输出所有( 单词) 输出第一个单词 ...
Read more »

PAT乙级1008

Posted on 2019-08-04 | | Visitors:
Words count in article: 708 字 | Reading time ≈ 3 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805316250615808 查了查网上的题解,情况如下: 一种方法是和我(题解一)一样的 这个方法真的奇葩,并不交换数组元素位置,只是根据n和m改变输出顺序, ...
Read more »

PAT乙级1007

Posted on 2019-08-04 | | Visitors:
Words count in article: 823 字 | Reading time ≈ 4 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805318855278592 题解一根据题意,素数对有两个特点:差为2、相邻,所以我们可以从3开始枚举每一对数字,然后再判断它们两个是不是素数。 这道题刚开始还是有一 ...
Read more »

PAT乙级1006

Posted on 2019-08-03 | | Visitors:
Words count in article: 547 字 | Reading time ≈ 3 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805318855278592 题解一这道题其实很简单,获取用户输入后,判断数字的位数,根据位数的不同,再获取百位、十位、个位的数字,然后据其进行字符串拼接,最后输出。 ...
Read more »

PAT乙级1004

Posted on 2019-07-22 | | Visitors:
Words count in article: 278 字 | Reading time ≈ 1 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805321640296448 题解 获取用户输入 排序 输出 代码如下: 123456789101112131415161718192021222324252627 ...
Read more »

mingw控制台中文乱码

Posted on 2019-07-22 | | Visitors:
Words count in article: 1,581 字 | Reading time ≈ 6 分
乱码原因直接先用一段话讲乱码原因,看不懂老老实实就往下看吧 其实我用Sublime或者VSCode等编辑器写代码出现的控制台中文乱码问题是编译器mingw输出的数据使用的是UTF-8编码,而控制台用了GBK编码来解析它。 其实编码只要统一用UTF8或者GBK都行,但用了错误的编码去解析文件就会出错。 ...
Read more »

PAT乙级1003

Posted on 2019-07-22 | | Visitors:
Words count in article: 1,100 字 | Reading time ≈ 5 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805323154440192 题解1这个是我自己的方法,..…刚开始做题,还啥都不会啊。 只能过4个Case,Case5过不了,得19分,还不知道哪里错了(让强迫症很 ...
Read more »
1…222324…32
臭咸鱼

臭咸鱼

祝你天天开心啊!

316 posts
182 tags
RSS
Links
  • Road Wide's Blog
  • Chou Xianyu's CNBlog
© 2018 — 2021 臭咸鱼 | Site words total count: 289.4k
Powered by Hexo
|
Theme — NexT.Gemini v5.1.4
本站总访问量 次