- #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;
- }

-
相关阅读:
CTF之信息收集
UE 插件模块引用
nuxt.js 进行项目重构-准备工作 项目分析
Prometheus + AlertManager 消息预警
21天学会C++:Day8----范围for与nullptr
PAT甲级考试知识点总结和一些看法
【Linux】软件管理器yum和编辑器vim
虹科技术 | 不用外部Redbox如何无缝合并PRP和HSR网络实现精确时间同步?
Istio(二):在Kubernetes(k8s)集群上安装部署istio1.14
retrofit网络框架源码解析
-
原文地址:https://blog.csdn.net/m0_73743794/article/details/132747950