C++實(shí)現(xiàn)簡(jiǎn)易選課系統(tǒng)代碼分享
下面是詳細(xì)代碼分享:
#include<bits/stdc++.h> using namespace std;
聲明函數(shù)部分:
//聲明函數(shù)部分 void BuildMainMenu();//聲明主菜單函數(shù) void SelectSytem(int AID,int who);//聲明選課系統(tǒng) void MyCourse(int AID,int who);//聲明我的課表 void PrintC(int who);//聲明打印課表函數(shù) void WrongW();//錯(cuò)誤提示函數(shù)
前置數(shù)據(jù)處理:
- 現(xiàn)有課程數(shù)據(jù)
course.txt
- 現(xiàn)有學(xué)生數(shù)據(jù)
students.txt
- 現(xiàn)有老師數(shù)據(jù)
teacher.txt
- 按順序合并為
date.txt.
初始狀態(tài)為:
- 1.無(wú)任何課程->導(dǎo)入現(xiàn)有課程數(shù)據(jù) (具體內(nèi)容見(jiàn)
Course
類(lèi)) - 2.無(wú)任何老師數(shù)據(jù)->導(dǎo)入老師數(shù)據(jù) (具體內(nèi)容見(jiàn)
teacher
類(lèi)) - 3.此時(shí)老師并沒(méi)有設(shè)置任何課程
- ->需要老師登陸系統(tǒng)進(jìn)行設(shè)置
- 該步驟需要手動(dòng)鍵入數(shù)據(jù),參考數(shù)據(jù)見(jiàn)
Setcourse.txt
- 4.無(wú)任何學(xué)生數(shù)據(jù)->導(dǎo)入學(xué)生數(shù)據(jù) (具體內(nèi)容見(jiàn)
student
類(lèi)) - 5.暫且令助教來(lái)自于學(xué)生,則助教的數(shù)據(jù)和學(xué)生數(shù)據(jù)一致
- 6.對(duì)于學(xué)生和助教,需通過(guò)學(xué)號(hào)和所設(shè)密碼進(jìn)入選課系統(tǒng)
//用于打印邊框 void PrintEgde(){puts("**********************************************");} //課程類(lèi) class Course { public: ?? ?int CourseId;//編號(hào) ?? ?string cousreName;//名稱(chēng) ?? ?int credit;//學(xué)分 ?? ?bool HaveSet=0;//判斷該門(mén)課是否被老師設(shè)置,沒(méi)有設(shè)置(0)則不能被學(xué)生選擇 ?? ?Course(){}//默認(rèn)構(gòu)造函數(shù),要記得寫(xiě) ?? ?//自定義的含參構(gòu)造函數(shù) ?? ?void SetCourse(int a,string b,int c){CourseId=a;cousreName=b;credit=c;} }; //AllList 存儲(chǔ)所有課程的信息 Course AllList[200]; int C_totalnum;//代表課程的總數(shù) class Person { public: ?? ?string name;//姓名 ?? ?int age;//年齡 ?? ?//構(gòu)造 ?? ?Person(){} ?? ?void SetPerson(string a,int b){name=a;age=b;} }; class teacher:public Person { public: ?? ?int teacherId;//老師的編號(hào) ?? ?int Len;//需要教授的課程數(shù)量 ?? ?int TeachCourse[10];//所授課程ID編號(hào) ?? ?int now_have=0;//已設(shè)置課程數(shù)量 ?? ?teacher(){}//默認(rèn)構(gòu)造函數(shù) ?? ?void Set_Teacher(string Name,int Age,int ID,int n)//構(gòu)造 ?? ?{ ?? ??? ?name=Name; ?? ??? ?age=Age; ?? ??? ?teacherId=ID; ?? ??? ?Len=n; ?? ?} ?? ?void teach(){cout<<"I am a teacher,I teach my student\n";} ?? ?//刪除已經(jīng)設(shè)置的課程 ?? ?void DeleteC(int CID) ?? ?{ ?? ??? ?system("cls");//用于清空cmd窗口 ?? ??? ?//如果當(dāng)前沒(méi)有課程可以刪除就直接返回 ?? ??? ?if(now_have==0)? ?? ??? ?{ ?? ??? ??? ?puts("You have set no course!"); ?? ??? ??? ?_sleep(500);//用于暫停0.5s ?? ??? ??? ?return; ?? ??? ?} ?? ??? ?//CAN用于判斷是否能取消設(shè)置某一門(mén)課(即要取消的課是否已被設(shè)置) ?? ??? ?int CAN=0; ?? ??? ?for(int i=1;i<=now_have;i++) ?? ??? ?{ ?? ??? ??? ?if(TeachCourse[i]==CID) ?? ??? ??? ?{ ?? ??? ??? ??? ?//可以取消,那么把原本設(shè)置好的最后一門(mén)課放到要取消的課的位置上 ?? ??? ??? ??? ?TeachCourse[i]=TeachCourse[now_have]; ?? ??? ??? ??? ?now_have--; ?? ??? ??? ??? ?CAN=1; ?? ??? ??? ??? ?break; ?? ??? ??? ?} ?? ??? ?} ?? ??? ?if(CAN==1) puts("You successfully deleted the course!"); ?? ??? ?else puts("There is no such course!");//不能取消設(shè)置的情況 ?? ??? ?_sleep(800); ?? ?} ?? ?void PrintNowteach()//輸出已設(shè)置課程 ?? ?{ ?? ??? ?system("cls"); ?? ??? ?puts(" ? ? ? ? ? ? <M y C o u r s e> ? ? ? ? ? ? ?\n"); ?? ??? ?PrintEgde(); ?? ??? ?//如果沒(méi)有課 ?? ??? ?if(now_have==0) puts("You have no course now!"); ?? ??? ?//如果有課 ?? ??? ?for(int i=1;i<=now_have;i++) ?? ??? ?{ ?? ??? ??? ?int x=TeachCourse[i];//取出課程編號(hào)方便下一行書(shū)寫(xiě) ?? ??? ??? ?printf("*%5d ? ?%-29s %4d *\n",AllList[x].CourseId,AllList[x].cousreName.c_str(),AllList[x].credit); ?? ??? ?} ?? ??? ?PrintEgde();putchar('\n'); ?? ??? ?printf({"You can input The CourseID to delete:(or -1 to return)"}); ?? ??? ?int flag=0;scanf("%d",&flag); ?? ??? ?if(flag==-1) return;//返回上一級(jí)系統(tǒng) ?? ??? ?else if(flag>0 && flag<=C_totalnum)//如果輸入的數(shù)字在限定范圍之內(nèi) ?? ??? ?{ ?? ??? ??? ?DeleteC(flag);//取消設(shè)置 ?? ??? ??? ?PrintNowteach();//并重置該頁(yè)面 ?? ??? ?} ?? ??? ?else//如果輸入的數(shù)字不在預(yù)設(shè)范圍內(nèi),進(jìn)行報(bào)錯(cuò)提示 ?? ??? ?{ ?? ??? ??? ?WrongW(); ?? ??? ??? ?PrintNowteach(); ?? ??? ?} ?? ?} ?? ?void setCourse(int CourseID) ?? ?//在已有課程中選擇屬于自己Teach的課程編號(hào) ?? ?{ ?? ??? ?system("cls"); ?? ??? ?//如果已經(jīng)選滿了 ?? ??? ?if(Len-now_have<=0)? ?? ??? ?{ ?? ??? ??? ?puts("You have already set all of your courses!"); ?? ??? ??? ?_sleep(800);return; ?? ??? ?} ?? ??? ?if(AllList[CourseID].HaveSet!=0)//如果已經(jīng)被別人設(shè)置了 ?? ??? ??? ?puts("This course has been set!"); ?? ??? ?else ?? ??? ?{ ?? ??? ??? ?puts("You successfully set the course!"); ?? ??? ??? ?TeachCourse[++now_have]=CourseID; ?? ??? ??? ?AllList[CourseID].HaveSet=1; ?? ??? ?} ?? ??? ?_sleep(800); ?? ?} }; teacher A_T[200];//所有老師的信息 int T_totalnum; class student:public Person { public: ?? ?long long number;//學(xué)號(hào) ?? ?int courseCount=0;//已選課程數(shù)目 ?? ?int mycourse[20];//已選課程的課程編號(hào) ?? ?int LeastNum;//至少選擇課程數(shù)目 ?? ?string key;//密碼 ?? ?student(){} ?? ?//此處age表示入學(xué)年份,如2021,2020 ?? ?void Set_student(string Name,int Age,long long Num,int n,string Key) ?? ?{ ?? ??? ?name=Name; ?? ??? ?age=Age; ?? ??? ?number=Num;//學(xué)號(hào) ?? ??? ?LeastNum=n; ?? ??? ?key=Key; ?? ??? ?memset(mycourse,0,sizeof(mycourse));//初始化已選課程數(shù)組 ?? ?} ?? ?void selectCourse(int CourseID) ?? ?{ ?? ??? ?system("cls"); ?? ??? ?//用于判斷自己是否已經(jīng)選過(guò)這門(mén)課程 ?? ??? ?bool HaveChoose = 0; ?? ??? ?for(int i=1;i<=courseCount;i++) ?? ??? ??? ?if(CourseID==mycourse[i])? ?? ??? ??? ??? ?HaveChoose=1; ?? ??? ?//如果該門(mén)課已經(jīng)被老師設(shè)置并且自己沒(méi)有選過(guò) ?? ??? ?if(AllList[CourseID].HaveSet && HaveChoose==0) ?? ??? ?{ ?? ??? ??? ?puts("You successfully stlect the course!"); ?? ??? ??? ?mycourse[++courseCount]=CourseID; ?? ??? ?} ?? ??? ?//老師沒(méi)有設(shè)置課程 ?? ??? ?else if(AllList[CourseID].HaveSet==0) puts("There is no such course!"); ?? ??? ?//自己已經(jīng)選過(guò) ?? ??? ?else if(HaveChoose==1) puts("This course you have chosen!"); ?? ??? ?_sleep(800); ?? ?} ?? ?void Delete(int CID) ?? ?{ ?? ??? ?system("cls"); ?? ??? ?if(courseCount==0) return; ?? ??? ?int CAN; ?? ??? ?for(int i=1;i<=courseCount;i++) ?? ??? ?{ ?? ??? ??? ?if(mycourse[i]==CID) ?? ??? ??? ?{ ?? ??? ??? ??? ?mycourse[i]=mycourse[courseCount]; ?? ??? ??? ??? ?courseCount--; ?? ??? ??? ??? ?CAN=1; ?? ??? ??? ??? ?break; ?? ??? ??? ?} ?? ??? ?} ?? ??? ?if(CAN==1) puts("You successfully deleted the course!"); ?? ??? ?else puts("There is no such course!"); ?? ??? ?_sleep(800); ?? ?} ?? ?//判斷是否滿足學(xué)校要求 ?? ?void judge() ?? ?{ ?? ??? ?if(courseCount>=LeastNum) //比較已選課程和要求課程數(shù)量 ?? ??? ??? ?puts("You can complete the credits of this semester"); ?? ??? ?else? ?? ??? ??? ?printf("You need to choose %d more courses\n",LeastNum-courseCount); ?? ?} }; student A_S[2000];//所有學(xué)生的信息 int S_totalnum;//學(xué)生的總數(shù) class TeachingAssistant:public teacher,public student { public: ?? ?void teach(){puts("I am a teaching assistant,I help my teacher teach his students");} ?? ?TeachingAssistant(){} ?? ?void selectCourse(int CourseID) ?? ?{ ?? ??? ?system("cls"); ?? ??? ?if(AllList[CourseID].HaveSet) ?? ??? ?{ ?? ??? ??? ?puts("You successfully stlect the course!"); ?? ??? ??? ?mycourse[++courseCount]=CourseID; ?? ??? ?} ?? ??? ?else puts("There is no such course!"); ?? ??? ?_sleep(800); ?? ?} ?? ?void Delete(int CID) ?? ?{ ?? ??? ?system("cls"); ?? ??? ?if(courseCount==0) return; ?? ??? ?int CAN; ?? ??? ?for(int i=1;i<=courseCount;i++) ?? ??? ?{ ?? ??? ??? ?if(mycourse[i]==CID) ?? ??? ??? ?{ ?? ??? ??? ??? ?mycourse[i]=mycourse[courseCount]; ?? ??? ??? ??? ?courseCount--; ?? ??? ??? ??? ?CAN=1; ?? ??? ??? ??? ?break; ?? ??? ??? ?} ?? ??? ?} ?? ??? ?if(CAN==1) puts("You successfully deleted the course!"); ?? ??? ?else puts("There is no such course!"); ?? ??? ?_sleep(800); ?? ?} }; TeachingAssistant A_TA[2500]; void Pre_course() { ?? ?//導(dǎo)入所有課程數(shù)據(jù) ?? ?int a,b;string c; ?? ?freopen("date.txt","r",stdin); ?? ?scanf("%d",&C_totalnum); ?? ?for(int i=1;i<=C_totalnum;i++) ?? ?{ ?? ??? ?cin>>a>>c>>b; ?? ??? ?//輸入編號(hào),名稱(chēng),學(xué)分 ?? ??? ?AllList[i].SetCourse(a,c,b); ?? ?} } void Pre_teacher() { ?? ?//導(dǎo)入所有老師數(shù)據(jù) ?? ?int a,b,c;string d; ?? ?scanf("%d",&T_totalnum); ?? ?for(int i=1;i<=T_totalnum;i++) ?? ?{ ?? ??? ?cin>>d>>a>>b>>c; ?? ??? ?//輸入姓名,年齡,編號(hào),應(yīng)設(shè)置課程數(shù)量 ?? ??? ?A_T[i].Set_Teacher(d,a,b,c); ?? ?} } void Pre_student() { ?? ?//導(dǎo)入所有學(xué)生數(shù)據(jù) ?? ?int a;long long b;string d,e; ?? ?scanf("%d",&S_totalnum); ?? ?for(int i=1;i<=S_totalnum;i++) ?? ?{ ?? ??? ?//姓名 入學(xué)年份 學(xué)號(hào) 至少選課數(shù)統(tǒng)一為2 ?? ??? ?cin>>d>>a>>b>>e; ?? ??? ?A_S[i].Set_student(d,a,b,2,e); ?? ??? ?A_TA[i].Set_student(d,a,b,2,e); ?? ?} } void Pre() //選課系統(tǒng)前置準(zhǔn)備工作 { ?? ?Pre_course();//導(dǎo)入課程數(shù)據(jù) ?? ?Pre_teacher();//導(dǎo)入老師數(shù)據(jù) ?? ?Pre_student();//導(dǎo)入學(xué)生數(shù)據(jù) } void WrongW()//報(bào)錯(cuò)提示 { ?? ?system("cls"); ?? ?puts("You entered the wrong one!"); ?? ?_sleep(500); } void MyCourse(int AID,int who) { ?? ?system("cls"); ?? ?puts(" ? ? ? ? ? ? <M y C o u r s e> ? ? ? ? ? ? ?\n"); ?? ?PrintEgde(); ?? ?if(who==0)//學(xué)生 ?? ?{ ?? ??? ?//沒(méi)課的情況 ?? ??? ?if(A_S[AID].courseCount==0) puts("You have no course now!"); ?? ??? ?//有課的情況 ?? ??? ?for(int i=1;i<=A_S[AID].courseCount;i++) ?? ??? ?{ ?? ??? ??? ?int x=A_S[AID].mycourse[i]; ?? ??? ??? ?printf("*%5d ? ?%-29s %4d *\n",AllList[x].CourseId,AllList[x].cousreName.c_str(),AllList[x].credit); ?? ??? ?} ?? ??? ?PrintEgde();putchar('\n'); ?? ??? ?A_S[AID].judge(); ?? ?} ?? ?else ?? ?{ ?? ??? ?if(A_TA[AID].courseCount==0) puts("You have no course now!"); ?? ??? ?for(int i=1;i<=A_TA[AID].courseCount;i++) ?? ??? ?{ ?? ??? ??? ?int x=A_TA[AID].mycourse[i]; ?? ??? ??? ?printf("*%5d ? ?%-29s %4d *\n",AllList[x].CourseId,AllList[x].cousreName.c_str(),AllList[x].credit); ?? ??? ?} ?? ??? ?PrintEgde();putchar('\n'); ?? ?} ?? ?//是否進(jìn)行退課操作 ?? ?printf({"You can input The CourseID to delete:(or -1 to return)"}); ?? ?int flag=0;scanf("%d",&flag); ?? ?if(flag==-1) SelectSytem(AID,who); ?? ?else if(flag>0 && flag<=C_totalnum) ?? ?{ ?? ??? ?if(who==0) A_S[AID].Delete(flag); ?? ??? ?else A_TA[AID].Delete(flag); ?? ??? ?MyCourse(AID,who); ?? ?} ?? ?else {WrongW();MyCourse(AID,who);} } void PrintC(int who) //打印所有課程信息 { ?? ?puts(" ? ? ? ? ? <Course Information> ? ? ? ? ? ? \n"); ?? ?PrintEgde(); ?? ?puts("*Course Id ? ? ? Name ? ? ? ? ? ? ? Credit ? *"); ? ? PrintEgde(); ?? ?if(who==1)//老師和助教 ? ? ?? ?for(int i=1;i<=C_totalnum;i++) ?? ??? ??? ?printf("*%5d ? ?%-29s %4d *\n",AllList[i].CourseId,AllList[i].cousreName.c_str(),AllList[i].credit); ?? ?else//學(xué)生 ?? ? ? ?for(int i=1;i<=C_totalnum;i++) ?? ??? ??? ?if(AllList[i].HaveSet) ?? ??? ??? ??? ?printf("*%5d ? ?%-29s %4d *\n",AllList[i].CourseId,AllList[i].cousreName.c_str(),AllList[i].credit); ?? ?PrintEgde();putchar('\n'); } void SelectSytem(int AID,int who) //who 0 代表學(xué)生 1 代表助教 { ?? ?system("cls"); ?? ?//打印所有課程信息 ?? ?PrintC(0); ?? ?//輸出學(xué)生姓名 .c_str()的作用是將string類(lèi)型的數(shù)據(jù)轉(zhuǎn)成char類(lèi)型,使得它可以用printf輸出 ?? ?printf("Student: %s .",A_S[AID].name.c_str()); ?? ?if(who==0)? ?? ??? ?A_S[AID].judge();//學(xué)生 ?? ?printf("Please enter the Course Id to select\nYou can input -1 to exit\nYou can input -2 to check Mycourse and delete course\nNow enter a number:"); ?? ?int flag=0;scanf("%d",&flag); ?? ?if(flag==-1) BuildMainMenu();//返回上一級(jí)菜單 ?? ?else if(flag==-2) MyCourse(AID,who);//查看已選課表 ?? ?else if(flag>0 && flag<=C_totalnum)//數(shù)據(jù)在預(yù)設(shè)范圍內(nèi),則選課 ?? ?{ ?? ??? ?if(who==0)//學(xué)生 ?? ??? ??? ?A_S[AID].selectCourse(flag),SelectSytem(AID,who); ?? ??? ?else A_TA[AID].selectCourse(flag),SelectSytem(AID,who);//助教 ?? ?} ?? ?else {WrongW();SelectSytem(AID,who);}//報(bào)錯(cuò) } void StudentSystem(int who) { ?? ?system("cls"); ?? ?//切換到從控制臺(tái)輸入數(shù)據(jù) ?? ?freopen("CON","r",stdin);? ?? ?//接下來(lái)為登陸頁(yè)面 ?? ?puts("Please enter your student number and ?password\n"); ?? ?PrintEgde();putchar('\n'); ?? ?printf("Student number:");long long SN;//輸入學(xué)號(hào) ?? ?scanf("%lld",&SN); ?? ?printf("Password: ? ? ?"); ?? ?char Pas[20],Acs[20];scanf("%s",Pas);//輸入密碼 ?? ?int AID;//在數(shù)據(jù)庫(kù)中的序號(hào) ?? ?//在數(shù)據(jù)庫(kù)中找到學(xué)號(hào)對(duì)應(yīng)的正確密碼 ?? ?for(int i=1;i<=S_totalnum;i++) ?? ??? ?if(A_S[i].number==SN){strcpy(Acs,A_S[i].key.c_str());AID=i;break;} ?? ?int times=2;//輸入密碼的機(jī)會(huì) ?? ?while(strcmp(Acs,Pas)!=0 && times>0) ?? ?//看輸入的密碼與正確密碼是否匹配,以及次數(shù)是否耗盡 ?? ?{ ?? ??? ?puts("Wrong Password!!!"); ?? ??? ?printf("you have %d times to enter the correct password\n",times); ?? ??? ?times--;scanf("%s",Pas); ?? ?} ?? ?//次數(shù)耗盡推出系統(tǒng) ?? ?if(times==0) ?? ?{ ?? ??? ?puts("I am sorry you can't enter our system!"); ?? ??? ?_sleep(800);exit(0); ?? ?} ?? ?if(who==0) SelectSytem(AID,who);//學(xué)生 ?? ?else SelectSytem(AID,1);//助教 } //老師設(shè)置課程 void Setcourse(int TID) { ?? ?system("cls"); ?? ?printf("Welcome : %s\n",A_T[TID].name.c_str()); ?? ?printf("You need to set %d courses\n\n",A_T[TID].Len-A_T[TID].now_have); ?? ?PrintC(1); ?? ?printf("Please enter the Course Id to set\nYou can input -1 to exit\nYou can input -2 to check Mycourse\nNow enter a number:"); ?? ?int flag=0;scanf("%d",&flag); ?? ?if(flag==-1) BuildMainMenu(); ?? ?else if(flag==-2) A_T[TID].PrintNowteach(),Setcourse(TID);//查看已設(shè)置的課程 ?? ?else if(flag>0 && flag<=C_totalnum)//設(shè)置課程 ?? ??? ?A_T[TID].setCourse(flag),Setcourse(TID); ?? ?else {WrongW();Setcourse(TID);} } void TeacherSystem() { ?? ?system("cls"); ?? ?freopen("CON","r",stdin); //切換到從控制臺(tái)輸入數(shù)據(jù) ?? ?puts(" ? ? ? ? Welcome ?to ?Teacher ?system! ? ? ? ?"); ?? ?PrintEgde();putchar('\n'); ?? ?//輸入教師編號(hào)以進(jìn)入系統(tǒng) ?? ?printf("Please enter your Teacher Id:"); ?? ?int TID;scanf("%d",&TID); ?? ?if(TID>0 && TID<=T_totalnum) ?? ??? ?Setcourse(TID); ?? ?else{ ?? ??? ?WrongW();TeacherSystem(); ?? ?} } void TASystem() { ?? ?//實(shí)際上助教系統(tǒng)可以看錯(cuò)和學(xué)生是一個(gè)系統(tǒng)的 ?? ?StudentSystem(1); } //構(gòu)建主菜單 void BuildMainMenu() { ?? ?system("cls"); ?? ?freopen("CON","r",stdin); //切換到從控制臺(tái)輸入數(shù)據(jù) ?? ?puts(" ? ? ?Welcome to course selection system! ? ? "); ?? ?PrintEgde(); ?? ?puts("* ? ? ? ? 1.Student entrance ? ? ? ? ? ? ? ? *"); ?? ?puts("* ? ? ? ? 2.Teacher entrance ? ? ? ? ? ? ? ? *"); ?? ?puts("* ? ? ? ? 3.TeachingAssistant ? ? ? ? ? ? ? ?*"); ?? ?puts("* ? ? ? ?-1.Exit this system ? ? ? ? ? ? ? ? *"); ?? ?PrintEgde();putchar('\n'); ?? ?printf("Please input 1,2,3 or -1 to enter this system:"); ?? ?int flag=-1;scanf("%d",&flag);//進(jìn)入子系統(tǒng) ?? ?if(flag==1) StudentSystem(0); ?? ?else if(flag==2) TeacherSystem(); ?? ?else if(flag==3) TASystem(); ?? ?else if(flag==-1) exit(0); ?? ?else ?? ?{ ?? ??? ?WrongW(); ?? ??? ?BuildMainMenu(); ?? ?} } int main()//主函數(shù) { ? ? Pre();//前置數(shù)據(jù)導(dǎo)入 ?? ?BuildMainMenu();//構(gòu)建主菜單 ?? ?return 0; }
/* date.txt 10? 1 Media_English 2 2 Literature_English 2 3 Drama_English 2 4 Academic_English 2 5 Cross-cultural_Communication 2 6 Public_Speaking 2 7 Intermediate_English_Speaking 2 8 Intermediate_English_Writing 2 9 Basic_Russian 2 10 Basic_French 2 5 Harry_potter 35 1 2 Hermione 34 2 3 Henry_rowen 36 3 1 Snape 55 4 2 Dumbledore 46 5 2 2 Jack 2021 2021001 123456! Tom 2021 2021002 abc123 */
到此這篇關(guān)于C++實(shí)現(xiàn)簡(jiǎn)易選課系統(tǒng)代碼分享的文章就介紹到這了,更多相關(guān)C++實(shí)現(xiàn)選課系統(tǒng)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
淺析VSCode launch.json中的各種替換變量的意思 ${workspaceFolder} ${file} $
這篇文章主要介紹了VSCode launch.json中的各種替換變量的意思 ${workspaceFolder} ${file} ${fileBasename} ${fileDirname}等,非常不錯(cuò)具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-03-03使用MinGW使Windows通過(guò)gcc實(shí)現(xiàn)C或C++程序本地編譯執(zhí)行的方法
這篇文章主要介紹了使用MinGW使Windows通過(guò)gcc實(shí)現(xiàn)C或C++程序本地編譯執(zhí)行的方法,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-11-11C++讀寫(xiě)(CSV,Yaml,二進(jìn)制)文件的方法詳解
為了處理文件,我們可以利用fstream庫(kù)。在這個(gè)庫(kù)里面有三種數(shù)據(jù)類(lèi)型:ofstream,ifstream,fstream。本文將利用這個(gè)庫(kù)實(shí)現(xiàn)不同文件的讀寫(xiě)操作,需要的可以參考一下2022-05-05c語(yǔ)言統(tǒng)計(jì)素?cái)?shù)之和的實(shí)例
這篇文章主要介紹了c語(yǔ)言統(tǒng)計(jì)素?cái)?shù)之和的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-12-12C++ 如何將string轉(zhuǎn)換成全小寫(xiě)
這篇文章主要介紹了C++ 如何將string轉(zhuǎn)換成全小寫(xiě)問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。2022-11-11Linux網(wǎng)絡(luò)編程之socket文件傳輸示例
這篇文章主要介紹了Linux網(wǎng)絡(luò)編程之socket文件傳輸示例,對(duì)于基于Linux平臺(tái)的C程序員來(lái)說(shuō)有一定的借鑒價(jià)值,需要的朋友可以參考下2014-08-08C++符號(hào)優(yōu)先級(jí)(詳細(xì)整理)
C++符號(hào)優(yōu)先級(jí),我詳細(xì)整理了一下。需要的朋友可以過(guò)來(lái)參考下。希望對(duì)大家有所幫助2013-10-10從頭學(xué)習(xí)C語(yǔ)言之for語(yǔ)句和循環(huán)嵌套
這篇文章主要為大家詳細(xì)介紹了C語(yǔ)言之for語(yǔ)句和循環(huán)嵌套,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下,希望能夠給你帶來(lái)幫助2022-01-01Vs2019+Qt+Opencv環(huán)境配置心得(圖文)
這篇文章主要介紹了Vs2019+Qt+Opencv環(huán)境配置心得(圖文),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-08-08