PAT
weixin_43070560
这个作者很懒,什么都没留下…
展开
-
PAT 1025 PAT Ranking (25 分)
PAT 1025 PAT Ranking (25 分) 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...原创 2019-08-06 19:05:06 · 150 阅读 · 0 评论 -
1093 Count PAT's (25 分)
The string APPAPT contains two PAT’s as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters. Now g...原创 2019-08-06 20:38:40 · 170 阅读 · 0 评论 -
1073 Scientific Notation (20 分)
1.stoi()函数的运用,将string转化为int 2.substr()函数的运用。s.substr(在s内要截取的起始位置,长度(不填则截取到最后))。 #include <iostream> #include <algorithm> #include <cmath> using namespace std; int main(){ string s;...原创 2019-08-18 17:38:12 · 81 阅读 · 0 评论 -
最大公约数和最小公倍数
最大公约数 辗转相除法 int gcd(int a,int b){ if(b==0) return a; return gcd(b,a%b); } 最小公倍数 求出最大公约数d; lcm(a,b)=ab/d;原创 2019-08-11 18:46:53 · 137 阅读 · 0 评论 -
1059 Prime Factors (25 分)
质因子分解 #include <iostream> #include <algorithm> #include <cmath> #include <cstring> using namespace std; const int maxn=100000; bool is_prime(int a){ if(a==1) return false; in...原创 2019-08-11 22:19:47 · 66 阅读 · 0 评论