随笔分类 -  PAT乙级练习题(C++)

摘要://读入 n(>0)名学生的姓名、学号、成绩,分别输出成绩最高和成绩最低学生的姓名和学号。 #include <iostream>#include <stdio.h>#include <string.h>typedef struct Student { char name[11]; char num 阅读全文
posted @ 2022-07-19 14:42 九饼多一点 阅读(71) 评论(0) 推荐(0)
摘要://读入一个正整数 n,计算其各位数字之和,用汉语拼音写出和的每一位数字。 #include <iostream>#include <stdio.h>#include <string.h> int main(void){ char num[102] = { 0 }; char pinyin[3] = 阅读全文
posted @ 2022-07-15 15:26 九饼多一点 阅读(32) 评论(0) 推荐(0)
摘要://对于一个任意的不超过1000的正整数,偶数除以二,奇数(3*n+1)除以2,到多少步才可以使得n=1#include <iostream> int main(int argc,const char* argv[]){ int n,cnt; cnt = 0; std::cin >> n; whil 阅读全文
posted @ 2022-07-15 14:16 九饼多一点 阅读(29) 评论(0) 推荐(0)