PAT乙级题解
PAT乙级自我总结
瓜子饮料八宝粥
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
1004 成绩排名 (20分)
#include<cstdio> #include<algorithm> using namespace std; struct Info{ char name[15]; char id[15]; int score; }stu[1010]; bool cmp(Info a,Info b){ return a.score<b.score; } int main() { int n; scanf("%d",&n); ...原创 2021-01-08 15:25:43 · 133 阅读 · 0 评论 -
1001 害死人不偿命的(3n+1)猜想 (15分)
#include<stdio.h> int main(){ int n,cnt=0; scanf("%d",&n); while(n!=1){ if(n%2){ n=(3*n+1)/2; }else{ n/=2; } cnt++; } printf("%d",cnt); return 0; } ...原创 2021-01-07 19:35:40 · 173 阅读 · 0 评论 -
1002 写出这个数 (20分)
#include<cstdio> #include<string.h> char rec[15][15]={"ling","yi","er","san","si","wu", "liu","qi","ba","jiu"}; int main() { char str[110]; int cnt=0; scanf("%s",str); for(int i=0;i<strlen(str);i++){ c...原创 2021-01-07 19:03:17 · 145 阅读 · 0 评论
分享