- 博客(30)
- 收藏
- 关注
原创 PAT(Basic Level) Practice (中文) 1030
【Basic Level】*1030 10个1 50个20#include <iostream>using namespace std;int main(){ int n; long long p; cin >> n >> p; long long *a = new long long[n]{}; for (int i = 0; i < n; ++i) { cin >> a[i
2021-08-15 22:15:29
149
原创 PAT(Basic Level) Practice (中文) 1029
【Basic Level】*1029#include <iostream>#include <string>#include <cctype>using namespace std;int main(){ string s, s1; cin >> s >> s1; int l = s.size(); int *a = new int[l]{}; int b[127] = {0};
2021-08-15 22:12:27
128
原创 PAT(Basic Level) Practice (中文) 1028
【Basic Level】*1028 条件连写排除不满足continue#include <iostream>#include <string>using namespace std;int main(){ int n; cin >> n; int m = 0; int max1 = 2014, max2 = 9, max3 = 6; int min1 = 1814, min2 = 9, min3 = 6;
2021-08-15 22:10:48
144
原创 PAT(Basic Level) Practice (中文) 1027
【Basic Level】*1027 剩余0也要输出#include <iostream>using namespace std;int main(){ int n; char c; cin >> n >> c; int m = (n - 1) / 2; if (m < 3) { cout << c << endl << n - 1 <<
2021-08-15 22:07:06
139
原创 PAT(Basic Level) Practice (中文) 1026
【Basic Level】*1026#include <iostream>#include <cmath> //四舍五入 round() 另外了解 floor() ceil()using namespace std;int main(){ int c1, c2; double n = 100; cin >> c1 >> c2; int h = 0, m = 0, s = 0; int c = round(d
2021-08-15 22:04:43
98
原创 PAT(Basic Level) Practice (中文) 1025
【Basic Level】*1025 printf("%05d",) 地址不会重复int main(){ int s, n, k; cin >> s >> n >> k; int a[100000], b[100000], c[100000]; for (int i = 0; i < n; ++i) { int address = 0, data = 0, next = 0; cin &
2021-08-15 22:03:04
101
原创 PAT(Basic Level) Practice (中文) 1024
【Basic Level】*1024#include <iostream>#include <cmath>#include <string>#include <algorithm>#include <iomanip>#include <cctype>#include <vector>using namespace std;int main(){ int a[10] = {}; int
2021-08-15 21:59:41
76
原创 PAT(Basic Level) Practice (中文) 1023
【Basic Level】*1023#include <iostream>#include <cmath>#include <string>#include <algorithm>#include <iomanip>#include <cctype>#include <vector>using namespace std;int main(){ int a[10] = {}; int
2021-08-15 21:53:38
72
原创 PAT(Basic Level) Practice (中文) 1022
【Basic Level】*1022 边界值输出 0#include <iostream>#include <string>using namespace std;int main(){ long long a , b; unsigned int d; string s; cin >> a >> b >> d; int c = a + b; if (c == 0) cou
2021-08-15 21:51:56
84
原创 PAT(Basic Level) Parctice (中文) 1021
【Basic Level】*1021 i的大小#include <iostream>#include <string>using namespace std;int main(){ string s; cin >> s; int n = s.length(); int a[10] = {}; for (int i = 0; i < n; ++i) { /* code */
2021-08-15 21:47:14
159
原创 PAT(Basic Level) Practice(中文) 1020
【Basic Level】*1020 需注意计算精度问题#include <iostream>#include <algorithm>#include <iomanip>#include <vector>using namespace std;typedef struct{ float n, p, u;} moon;bool cmp(moon p1, moon p2){ return p1.u > p2.u;}
2021-08-14 23:58:16
109
原创 PAT(Basic Level) Practice(中文) 1019
【Basic Level】*1019 //输出数字格式 边界条件#include <iostream>#include <algorithm>using namespace std;bool cmp(int a, int b){ return a > b;}int main(){ int n; cin >> n; int a[4]; a[3] = n % 10; a[2] = n / 10 %
2021-08-14 23:56:19
90
原创 PAT(Basic Level) Practice(中文) 1018
【Basic Level】*1018#include <iostream>#include <cmath>#include <string>#include <algorithm>#include <iomanip>#include <cctype>#include <vector>using namespace std;int main(){ int n; cin >>
2021-08-14 23:54:26
131
原创 PAT(Basic Level) Practice(中文) 1017
【Basic Level】*1017#include <iostream>#include <cmath>#include <string>#include <algorithm>#include <iomanip>#include <cctype>#include <vector>using namespace std;int main(){ string s; int b;
2021-08-14 23:52:30
81
原创 PAT(Basic Level) Practice(中文) 1016
【Basic Level】*1016#include <iostream>#include <cmath>#include <string>#include <algorithm>#include <iomanip>#include <cctype>#include <vector>using namespace std;int main(){ int a, b, a1, b1, sum =
2021-08-14 23:51:08
79
原创 PAT(Basic Level) Practice(中文) 1015
【Basic Level】*1015#include <iostream>#include <cmath>#include <string>#include <algorithm> //sort 数组、链表、向量#include <iomanip>#include <cctype>#include <vector>using namespace std;typedef struct{ /* d
2021-08-14 23:49:19
102
原创 PAT(Basic Level) Practice(中文) 1014
【Basic Level】*1013#include <iostream>#include <cmath>#include <string>#include <algorithm>#include <iomanip>using namespace std;bool isPrime(int m){ for (int i = 3; i <= sqrt(m); i++) { if (m % i =
2021-08-14 23:45:10
106
原创 PAT(Basic Level) Practice (中文) 1013
【Basic Level】*1013#include <iostream>#include <cmath>#include <string>#include <algorithm>#include <iomanip>using namespace std;bool isPrime(int m){ for (int i = 3; i <= sqrt(m); i++) { if (m % i =
2021-08-14 23:41:39
164
原创 PAT(Basic Level) Practice(中文) 1012
【Basic Level】*1012 输出N的条件判断#include <iostream>#include <cmath>#include <string>#include <algorithm>#include <iomanip> // cout << setiosflags(ios::fixed) << setprecision(n);using namespace std;int main(){
2021-08-05 23:53:35
84
原创 PAT(Basic Level) Practice(中文) 1011
【Basic Level】*1011 注意数值范围#include <iostream>#include <cmath>#include <string>#include <algorithm>using namespace std;int main(){ string s = "Case #"; int n = 0; cin >> n; long long a = 0, b= 0, c =0 ,
2021-08-05 23:49:09
74
原创 PAT(Basic Level) Practice(中文) 1010
【Basic Level】*1010 注: 0 0#include <iostream>#include <cmath>#include <string>#include <algorithm>using namespace std;int main(){ int a = 0, b = 0, f = 1; while (cin >> a >> b) { if (b > 0)
2021-08-05 23:47:46
117
原创 PAT(Basic Level) Practice(中文) 1009
【Basic Level】*1009 getline(cin, string s) 读取一行字符串#include <iostream>#include <cmath>#include <string>#include <algorithm>using namespace std;int main(){ string s, c; getline(cin, c); int len = c.length(); fo
2021-08-05 23:45:51
179
原创 PAT(Basic Level) Practice(中文) 1008
【Basic Level】*1008 特殊情况 m %= n#include <iostream>#include <cmath>#include <string>#include <algorithm>using namespace std;bool isPrime(int m){ for (int i = 3; i <= sqrt(m); i++) { if (m % i == 0)
2021-08-05 23:43:27
133
原创 PAT(Basic Level) Practice(中文) 1007
【Basic Level】*1007#include <iostream>#include <cmath>#include <string>#include <algorithm>using namespace std;bool isPrime(int m){ for (int i = 3; i <= sqrt(m); i++) { if (m % i == 0) {
2021-08-05 23:41:05
71
原创 PAT(Basic Level) Practice(中文) 1006
【Basic Level】*1006#include <iostream>#include <cmath>#include <string>#include <algorithm>using namespace std;int main(){ int n = 0; cin >> n; int a = 0, b = 0, c = 0; c = n % 10; b = n / 10 % 10;
2021-08-05 23:39:35
103
原创 PAT(Basic Level) Practice(中文) 1005
【Basic Level】*1005#include <iostream>#include <cmath>#include <string>#include <algorithm>using namespace std;int main(){ int n = 0, i = 0, a[100], b[100] = {0}; cin >> n; while (n--) { cin >
2021-08-05 23:38:22
119
原创 PAT(Basic Level) Practice(中文) 1004
【Basic Level】*1004#include <iostream>#include <cmath>#include <string>#include <algorithm>using namespace std;int main(){ int n=0; string s1, s2, m1, m2, n1, n2; int grade, gm = 0, gn = 0; cin >> n;
2021-08-05 23:37:09
83
原创 PAT(Basic Level) Practice(中文) 1003
【Basic Level】*1003 找出规律#include <iostream>#include <string>using namespace std;bool isPAT(string s0) { int a = 0, b= 0; int ca = 0, cb = 0; for (int i = 0; i < s0.length(); i++) { if (s0[i] != 'P' &
2021-08-05 23:35:01
134
原创 PAT(Basic Level) Practice (中文) 1002
这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Markdown编辑器你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Mar
2021-08-04 00:08:48
118
原创 PAT(Basic Level) Practice (中文)1001
【Basic Level】*1001 卡拉兹(Callatz)猜想#include <iostream>#include <cmath>using namespace std;int main(){ int n, c = 0; cin >> n; while (n != 1) //n变化后不能使结果跳出判断 (error : &&n<1000) { /* code */ .
2021-08-03 23:55:48
62
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人