
PAT考试
谁还不是个小屁孩
海边微风起,等风也等你
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
10. 排序(2)
1.A1075 #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; const int maxn = 10010; struct Student{ int id; int score[6]; bool flag; int score_all; i...原创 2020-01-20 21:16:00 · 177 阅读 · 0 评论 -
9. 排序(1)
1.A1012 #include<stdio.h> #include<iostream> #include<math.h> #include<algorithm> using namespace std; struct Student{ int id; int grade[4]; }stu[2010]; char Course[4] = {'A...原创 2020-01-20 21:13:49 · 215 阅读 · 0 评论 -
8. 字符串处理(2)
1.B1009 #include<stdio.h> int main(){ int num = 0; char ans[90][90]; while(scanf("%s",ans[num])!=EOF){ num++; } for(int i = num-1;i>=0;i--){ printf("%s",ans[i]); if(i!=0) printf("...原创 2020-01-20 14:51:34 · 216 阅读 · 0 评论 -
7. 字符串处理(1)
1.A1001 #include<stdio.h> int main(){ int a,b; scanf("%d%d",&a,&b); int A[5],i = 0; int sum = a+b; if(sum<0){ printf("-"); sum = -sum; } if(sum==0) printf("0"); else{ w...原创 2020-01-20 14:49:23 · 292 阅读 · 0 评论 -
6. 进制转换
1.A1019 #include<stdio.h> bool judge(int z[],int num){ for(int i = 0;i<=num/2;i++){ if(z[i]!=z[num-i-1]) return false; return true; } } int main(){ int n,b,z[40],num = 0; scanf("%...原创 2020-01-20 14:45:50 · 289 阅读 · 0 评论 -
5. 图形输出
1.A1031 #include<stdio.h> #include<string.h> int main(){ char str[100]; gets(str); int N = strlen(str); int n1 = (N+2)/3,n3 = n1,n2 = N+2-n1-n3; for(int i = 0;i<n1-1;i++){ prin...原创 2020-01-20 14:43:58 · 300 阅读 · 0 评论 -
4. 查找元素
1.A1006 #include<stdio.h> #include<iostream> #include<string.h> using namespace std; struct pNode{ char id[20]; int hh,mm,ss; }temp,ans1,ans2; bool great(pNode a,pNode b){ if(a.h...原创 2020-01-20 14:41:40 · 218 阅读 · 0 评论 -
3. 算法入门简单模拟(3)
1.B1018 #include<stdio.h> int change(char c){ if(c == 'B') return 0; if(c == 'C') return 1; if(c == 'J') return 2; } int main(){ char mp[3] = {'B','C','J'}; int n; scanf("%d",&n); ...原创 2020-01-20 14:37:47 · 141 阅读 · 0 评论 -
2. 算法入门简单模拟(2)
1.B1001 #include<stdio.h> int main(){ int n; while(scanf("%d",&n)!=EOF){ int s = 0; while(n!=1){ if(n%2==0) n/=2; else n = (3*n+1)/2; s++; } printf("%d\n",s); } ...原创 2020-01-20 14:34:55 · 173 阅读 · 0 评论 -
1. 算法入门简单模拟(1)
1.A1002 #include<stdio.h> const int maxn = 1100; double p[maxn] = {0}; int main(){ int n,k,count = 0; double a; scanf("%d",&k); while(k--){ scanf("%d %lf",&n,&a); p[n] += a...原创 2020-01-20 14:31:25 · 266 阅读 · 0 评论