- #include
-
- using namespace std;
- struct stu
- {
- private:
- int num;
- private:
- double score[32];
-
- public:
- void setNum()
- {
- cout <<"请输入学生人数:";
- cin >>num;
- }
- void input()
- {
- cout<<"请输入学生的成绩:"<
- for(int i=0; i
- {
- cout<<"第"<1<<"个学生成绩:";
- cin>>score[i];
- }
- }
- void sort()
- {
- double temp;
- int flag = 0;
- for(int i=1; i
- {
- flag =0;
- for(int j=0; j
- {
- if(score[j]
1]) - {
- temp = score[j];
- score[j] = score[j+1];
- score[j+1] = temp;
- flag = 1;
- }
- }
- if(0 ==flag)
- break;
- }
- }
- void show()
- {
- for(int i=0; i
- {
- cout <
" "; - }
- cout <
- }
- };
- int main()
- {
- stu s;
- s.setNum();
-
- s.input();
-
- s.sort();
-
- s.show();
-
- return 0;
- }

-
相关阅读:
JavaScript学习笔记01
mybatis:关联关系映射
MySQL 面试题——数据库理论基础
Fabric.js 元素被遮挡的部分也可以操作~
期末测试——JavaScript方式练习题
科研基础与工具(论文搜索)
概念解析 | 量子时代的灵感:探索量子感知技术
AI视频风格转换:Stable Diffusion+EBSynth
spring 如何获取当前类在容器中的beanname呢?
Dubbo-RPC核心接口介绍
-
原文地址:https://blog.csdn.net/m0_73743794/article/details/132747950