![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
nameix
这个作者很懒,什么都没留下…
展开
-
JAVA PAT-1003
得到“答案正确”的条件是:1. 字符串中必须仅有P, A, T这三种字符,不可以包含其它字符;2. 任意形如 xPATx 的字符串都可以获得“答案正确”,其中 x 或者是空字符串,或者是仅由字母 A 组成的字符串;3. 如果 aPbTc 是正确的,那么 aPbATca 也是正确的,其中 a, b, c 均或者是空字符串,或者是仅由字母 A 组成的字符串。现在就请你为PAT写一个原创 2016-05-20 16:35:52 · 849 阅读 · 0 评论 -
Java 素数
素数:质数,只能被1和它本身整除(1,不是质数,2是质数)规律:非质数都能被2或者3整除(2除外),但是不能被2,,3整除的数不一定都是素数(49,15,,)判断方法:方法一:从3 num开始:利用for循环,用 { num% (2----sqrt(num))====0 } 来判断方法二:判断这个数能不能被小于这个数的平方根的素数整除原创 2016-07-26 09:39:17 · 471 阅读 · 0 评论 -
PAT----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 input file cont原创 2016-09-13 10:56:16 · 274 阅读 · 0 评论 -
PAT----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 the information of a p原创 2016-09-13 14:05:28 · 245 阅读 · 0 评论