網站首頁 編程語言 正文
本文實例為大家分享了C++實現簡單班級成績管理系統的具體代碼,供大家參考,具體內容如下
#include#include #include #include #include using namespace std; int n=0; class Student {public: ? ?? ?string name; ? ? string num; ? ? char cclass[20]; ? ? int lisan; ? ? int gaoshu; ? ? int dianlu; ? ? int sum; ? ? /*--------------------------輸入函數-----------------------------*/ ? ? void input() ? ? { ? ? ? ? cout<<"\t請輸入姓名:"; ? ? ? cin>>name; ? ? ? ? cout<<"\t請輸入學號:"; ? ? ? cin>>num; ? ? ? ? cout<<"\t請輸入班級:"; ? ? ? cin>>cclass; ? ? ? ? cout<<"\t請輸入離散成績:"; ? cin>>lisan; ? ? ? ? cout<<"\t請輸入高數成績:"; ? cin>>gaoshu; ? ? ? ? cout<<"\t請輸入電路成績:"; ? cin>>dianlu; ? ? ? ? sum=lisan+gaoshu+dianlu; ? ? } ? ? /*------------------------------show函數------------------------*/ ? ? void show() ? ? { ? ? ? ? cout<<"姓名:"< >a; ? ? switch(a) ? ? { ? ? case 1:{ ? ? ? ? cout<<"請輸入需查找學生的學號:"; ? ? ? ? cin>>bp; ? ? ? ? z=snum(bp); ? ? ? ? if(z!=-1) ? ? ? ? stu[z].show(); ? ? ? ? else ? ? ? ? cout<<"沒有找到該學生"< >ap; ? ? ? ? z=sname(ap); ? ? ? ? if(z!=-1) ? ? ? ? stu[z].show(); ? ? ? ? else ? ? ? ? cout<<"沒有找到該學生"< >cp; ? ? k=snum(cp); ? ? if(k!=-1) ? ? {cout<<"已找到,請輸入新的信息。"< stu[k+1].sum) ? ? ? ?{t=stu[k].sum;stu[k].sum=stu[k+1].sum;stu[k+1].sum=t;flag=1;} ? ? ? ?if (flag==0) ? ? ? ?break; ? ? } ? ? for( k = 0; k >dp; ? ? y=snum(dp); ? ? if(y!=-1) ? ? { ? ? for(;y >y; ? ? switch(y) ? ? { ? ? case 1:h.add();break; ? ? case 2:h.display();break; ? ? case 3:h.change();break; ? ? case 4:h.sort();break; ? ? case 5:h.find();break; ? ? case 6:h.dele();break; ? ? case 7:ss="n";break; ? ? } ?? ?}while(ss=="y"); ? ? return 0; }
原文鏈接:https://blog.csdn.net/wind_day/article/details/76468175
相關推薦
- 2021-12-24 基于PostgreSQL/openGauss?的分布式數據庫解決方案_PostgreSQL
- 2022-08-04 C語言實現快速排序算法實例_C 語言
- 2022-07-03 axios項目封裝及使用
- 2022-06-26 asp.net使用WebAPI和EF框架結合實現數據的基本操作_實用技巧
- 2022-06-02 基于Redis6.2.6版本部署Redis?Cluster集群的問題_Redis
- 2022-11-05 Python?sklearn庫三種常用編碼格式實例_python
- 2023-04-02 linux?top命令基本實戰_linux shell
- 2022-02-14 el-form的label和表單自適應填滿一行且靠左對齊
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支