PTA甲级刷题 c/c++
Sylvia_Lyn
HDU在校
展开
-
1059 Prime Factors (25分) c++
原题 #include <cstdio> #include <cstring> #include <cmath> const int maxn=100010; bool isnotPrime[maxn]={false};//不能初始化为true,否则其它还会是false int prime[maxn]={0}; int priNum=0; void olaPr...原创 2020-03-09 23:14:45 · 127 阅读 · 0 评论 -
pta 甲级 1069 The Black Hole of Numbers /乙级 1019 数字黑洞 c++
原题链接: 甲级1069 乙级1019 给定任一个各位数字不完全相同的 4 位正整数,如果我们先把 4 个数字按非递增排序,再按非递减排序,然后用第 1 个数字减第 2 个数字,将得到一个新的数字。一直重复这样做,我们很快会停在有“数字黑洞”之称的 6174,这个神奇的数字也叫 Kaprekar 常数。 例如,我们从6767开始,将得到 7766 - 6677 = 1089 9810 - 0189...原创 2020-03-03 20:34:00 · 191 阅读 · 0 评论 -
PTA 甲级1025 PAT Ranking
Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ranklists w...原创 2020-02-02 12:13:26 · 130 阅读 · 0 评论