素数
shishiness
这个作者很懒,什么都没留下…
展开
-
2020年7月pat甲级 第一题
题意:给一个数(比如20190301),每次去除最前面的一个数字,判断去除该数字之后的数 是不是素数。 #include<iostream> using namespace std; bool isprime(int n){ if(n<=1) return false; for(int i=2;i*i<=n;i++){ if(n%i==0) return false; } return true; } int main(){ string s; cin>.原创 2020-07-26 09:55:55 · 134 阅读 · 0 评论 -
pat 甲级 素数 A1059 Prime Factors (25分)
1059 Prime Factors (25分) Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1k1×p2k2×⋯×pmkm. Input Specification: Each input file contains one test case which giv原创 2020-08-28 19:09:27 · 78 阅读 · 0 评论 -
pat 甲级 素数 进制转换 A1015 Reversible Primes (20分)
1015 Reversible Primes (20分) A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also a prime. Now given any two po原创 2020-07-24 01:03:59 · 62 阅读 · 0 评论 -
pat 甲级 素数 A1152 Google Recruitment (20分)
1152 Google Recruitment (20分) In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is super-simple, a URL consisting of the first 10-digit prime found in consecutive原创 2020-08-27 20:08:15 · 82 阅读 · 0 评论 -
pat 甲级 素数 A1116 Come on! Let‘s C (20分)
1116 Come on! Let's C (20分) "Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun, the award rules are funny as the following: 0、 The Cha原创 2020-08-27 20:08:01 · 78 阅读 · 0 评论