亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 編程 > C++ > 正文

C++實現校園運動會報名系統

2020-05-23 13:25:48
字體:
來源:轉載
供稿:網友

本文為大家分享了C++實現校園運動會報名系統的具體代碼,供大家參考,具體內容如下

main.cpp 

#include "Campus.h"#include "List.h"/*校園運功會報名系統  實現報名信息錄入 和 展示 *//*    信息錄入  1 . 建立運動會項目信息表 , 字段包括 , 項目編號 , 項目名稱 , 學生姓名 ,院系 ,班級 ,性別    年齡,參賽時間 ,報名時間 ;  2  完成運動會報名信息新增頁 ,  3 查詢報名 情況      4管理員系統可以更改報名截止時間 和 運動員的可想更改 (可以改成英文版和中文版切換)  */int main(){  ShowPage();  return 0;}

Campush.h 

#ifndef CAMPUS_H#define CAMPUS_H#include "List.h"void ShowPage();void MenuChoose(); // 主菜單void Apply_System();// 報名系統void Show_Apply_System(); // 報名系統頁面void Apply_Information_Query();// 信息查詢void show_in_AdSYstem();// 管理員展示頁面void Administrator_System();// 管理員系統;void Athlete_Information(); // 運動員信息查詢void Sport_item_sign(); // 運動項目報名void printList_new(Message &M); // 打印帶有項目的信息bool Judge_IF_sign(char *) ; // 判斷學生是否報名項目void Point_Base_Me(char *Temp); // 打印運動員信息void AD_Menu(); // 管理員系統菜單void Manage_system();// 管理員系統void Log_Administrator();void AD_Menu2();void Cancel_signup();void Revise_Data();void Enter_Adsystem(); // 管理員登錄bool Judge_IF_Past_due();// 判斷是否逾期;extern void Go_back1(); // 返回第一頁extern void Go_back2(); // 返回第二頁;extern void Go_back3();extern void Go_back4();#endif // CAMPUS_H

List.cpp

 

#include "List.h"#include "Campus.h"#include <iostream>#include <cstdio>#include <cstdlib>#include <windows.h>#include <io.h>using namespace std ;void Gettime_f(int &year ,int &month ,int &day ,int &hours ,int &minutes ,int &second ){ /*獲取本地時間 */ time_t now ; struct tm *tm_now ; time(&now) ; tm_now = localtime(&now) ; year = tm_now->tm_year+1900 ; month = tm_now->tm_mon+1 ; day = tm_now->tm_mday ; hours = tm_now->tm_hour ; minutes = tm_now->tm_min ; second = tm_now->tm_sec ; return ;}Status List::CreatList(LinkList &L,int n){ // 創建鏈表; int i ; time_t now ; struct tm *tm_now ; time(&now) ; tm_now = localtime(&now) ; LinkList p ; LinkList head =NULL ; LinkList Last ; for(i=0 ; i<n ;i++) { system("cls"); cout<<"請輸入第 " <<i+1<<"名學生信息 : "<<endl; p = (LinkList )malloc(sizeof(LNode)) ; if(p==NULL) {  cout<<"CreatList fail "<<endl;  exit(ERROR) ; } cout<<"姓名"<<" " ; cin>> p->data.name ; cout<<endl; cout<<"學號"<<" :"; cin >>p->data.IDcard ; cout<<endl; cout<<"性別"<<" :" ; cin>> p->data.gender; cout<<endl; cout<<"年齡"<<" :" ; cin>> p->data.age ; cout<<endl; cout<<"學院"<<" :" ; cin>> p->data.Institute ; cout<<endl; cout<<"班級"<<" :" ; cin>> p->data.Class; cout<<endl; /* strcpy(p->data.sport_it1,"000"); strcpy(p->data.sport_it2,"000");*/  p->next = NULL ;  Gettime_f(p->data.Join_time.year ,p->data.Join_time.month ,p->data.Join_time.day ,p->data.Join_time.hours  ,p->data.Join_time.minutes ,p->data.Join_time.second) ;  if(head == NULL)  head = p ; else {  Last->next = p ; } Last = p ;   } L = head ; FILE_Memory(L);  cout<< " 信息錄用成功"<< endl; return OK ;} Status List::GetElem(LinkList &L,int i ,Message &e){ /*   條件:線性表存在;    操作結果 : 如果 i 合法 得到線性表第i位置上的元素,反饋給e ; L 是不帶頭結點的; */ LinkList p ; if(!L) { cout<<" GetElem failed"<<endl; exit(ERROR) ; } p = L ; int k = 1 ; while(p) { if(k>=i) break ; ++k; p = p->next ;  } if(!p || k>i) { cout<<"沒找到"<<endl; e.age = UNFOUND ; e.gender = 'F' ; strcpy(e.Class,""); strcpy(e.Institute,""); strcpy(e.name,"");  } e = p->data ; return OK ;} Status List::printList(LinkList &L ){ /* 打印線性表 */ LinkList p = L ; while(p) { cout<<"姓名 : " <<p->data.name <<endl; cout<<"學號 : " <<p->data.IDcard <<endl; cout<<"性別 : "<<p->data.gender<<endl; cout<<"年齡 : "<<p->data.age<<endl; cout<<"學院 : "<<p->data.Institute<<endl; cout<<"班級 : "<<p->data.Class<<endl; cout<<"報名時間 : "<<p->data.Join_time.year<<"-"<<p->data.Join_time.month<<"-"<< p->data.Join_time.day <<" "<<p->data.Join_time.hours<<":"<<p->data.Join_time.minutes<<":"<<p->data.Join_time.second<<endl;  p = p->next ; } return OK;} void FILE_Memory(LinkList &L){ FILE *fin ; int res ; char m[MAX] ; char n[MAX] ; char Name[MAX] ; LinkList p = L; if(L==NULL) { cout<<"L is NULL "<<endl; exit(0); } char cpy_Path[MAX] ={'/0'} ; system("cls"); while(p) { //再加一個掃描 , 看是否有重名 ; strcpy(cpy_Path,Path1) ; char T[MAX] ; strcpy(T,strcat( strcat(cpy_Path,p->data.IDcard),".txt")); int Judge = ScanRepetition(T) ;// 掃描是否有重名;  if(Judge == 0) // 存在返回0 {    char ch ;  cout<<"你輸入的學號已經被錄入或者您輸入的學號有誤,請不要重復錄入. "<<endl;  remove(T); // 操作失敗文件刪除  Go_back2(); } else {  strcpy(Name,p->data.IDcard ) ;  strcpy(n,strcat(Name, ".txt")); // zhs.txt  strcpy(m,Path1); // D://dos//SportSystem//  strcat(m,n); // D://dos//SportSystem//zhs.txt }  fin = fopen(m,"a+"); if( !fin) {  cout<<"Creat_fin ERROR "<<endl;  exit(0) ; } fprintf(fin,"%s %s %d %c %s %s %d %d %d %d %d %d /n",p->data.IDcard ,p->data.name,p->data.age,p->data.gender ,p->data.Institute, p->data.Class ,p->data.Join_time.year ,p->data.Join_time.month , p->data.Join_time.day ,p->data.Join_time.hours ,p->data.Join_time.minutes, p->data.Join_time.second);  memset(m,'/0',sizeof(m)); memset(n,'/0',sizeof(n)); memset(Name,'/0',sizeof(Name)); memset(cpy_Path,'/0',sizeof(cpy_Path)) ; memset(T,'/0',sizeof(T)); p = p->next ; } fclose(fin); return ;}int ScanRepetition(char *file_name){ // 掃描 ; /* int  access(const  char  *filename,  int  amode); amode參數為0時表示檢查文件的存在性,如果文件存在,返回0,不存在,返回-1。 */ return access(file_name,0); }

List.h

#ifndef LIST_H#define LIST_H#include <iostream>#include <cstdlib>#include <direct.h>#include <time.h>#define OK 1#define ERROR 0#define UNFOUND -1#define Path1 "D://dos//SportSystem//"using namespace std ;const int MAX = 200 ;typedef int Status ;typedef int ElemType ;typedef struct AD_number{ char num[MAX]; char password[MAX]; }AD;typedef struct Person{ char num[MAX] ; char name[MAX] ;}Per;typedef struct Data_location{ int year ; int month ; int day ; int hours ; int minutes ; int second ;}Data;typedef struct Athlete_Message{ char IDcard[MAX] ; char name[MAX] ; // 姓名 char gender ; // 性別 int age ; char Institute[MAX] ; // 學院 char Class[MAX] ;// 班級; Data Join_time; // char sport_it1[MAX] ; // 項目一 char sport_it2[MAX] ; // 項目二}Message;typedef struct node{ Message data ; struct node *next ;}LNode, *LinkList;class List{  public:    Status CreatList(LinkList &L,int n) ;    Status GetElem(LinkList &L,int i ,Message &e) ;    Status printList(LinkList &L ) ;    private : Message e ;};int ScanRepetition(char * );void FILE_Memory(LinkList &L);void Srearch_city_fiction(FILE *fp);void Gettime_f(int &year ,int &month ,int &day ,int &hours ,int &minutes ,int &second );#endif // LIST_H

Campus.cpp

#include "Campus.h"#include "List.h"#include <windows.h>#define Path2 "D://dos//Administrator//"void ShowPage(){ cout<<endl<<endl;  cout<<"/t/t/t  ***********************************"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t校 園 運 動 會 報 名 系 統  *"<<endl ;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ☆"<<" 1 報名系統進入  ☆  *"<<endl; cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ☆"<<" 2 報名信息查詢  ☆  *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ☆"<<" 3 運動員信息   ☆  *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ☆"<<" 4 退出系統    ☆  *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ☆"<<" 0 管理員系統   ☆  *"<<endl;   cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  ***********************************"<<endl;  MenuChoose();  return ;}void MenuChoose(){  int num ;  cout<<endl;  cout<<"========================================================================"<<endl;  cout<<"功能選擇"<<endl;  if(scanf("%d",&num)) // 正常輸入  {    switch (num)    {      case 1:        {            system("cls");// 清屏轉換下一級功能;   Show_Apply_System();           }        break ;      case 2:        {         Apply_Information_Query();          }        break ;      case 3:        {   Athlete_Information();           }        break ;  case 0:  {   Administrator_System();     }  break ;  case 4:  {   exit(0);     }      default :        {          cout<<"ERORR"<<endl;          exit(ERROR);        }    }   }   return ;}void Apply_System(){ /*報名系統 */ FILE *fp ; List a ; // 對象 LinkList L ; // int i ,n ; char ch1,ch2 ; char ch3 ; cout<<"個數"<<endl; cin >> n ; a.CreatList(L,n); cout<<" 身份信息確認 "<<"[y/n]"<<" "; cin >>ch1 ; if(ch1=='y') { cout<<" 確認成功 "<<endl; Sleep(1); } cout<<" 身份信息查看 "<<"[y/n]"<<" "; cin >>ch2 ; if(ch2=='y') { a.printList(L); Sleep(500); } Go_back1();   return ;}void Show_Apply_System(){ int index ; cout<<endl<<endl<<endl;  cout<<"/t/t/t  ***********************************"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t   報 名 系 統      *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ◎"<<" 1 學生信息錄入   ◎  *"<<endl; cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ◎"<<" 2 運動項目報名   ◎  *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ◎"<<" 3 返回上一頁    ◎  *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  ***********************************"<<endl; cout<<"請選擇"<<endl; cin >>index ; if(index == 1) { Apply_System();// 錄用信息 } else if(index ==2 ) { LinkList L ; cout<<"運動項目報名"<<endl; Sport_item_sign();  } else if( index == 3) { system("cls"); ShowPage(); } else { Go_back2(); }  return ;}void Sport_item_sign(){ // 首先 參看運動會參賽注意事項; char ch ; char ih ; int it1,it2 ; char Id[MAX] ; char Cpy_path1[MAX] ; Message M ,Stu; Data d ; FILE *fp = fopen("Data.txt","r"); cout<<"注意報名截止時間 : "; if(!fp) { exit(0); }  fscanf(fp ,"%d%d%d%d%d%d",&d.year,&d.month,&d.day,&d.hours ,&d.minutes ,&d.second); printf("[ %d -%d -%d  %d:%d: %d  ]/n",d.year,d.month,d.day,d.hours ,d.minutes ,d.second); cout<<endl; if(Judge_IF_Past_due() == true ) { // 時間過期; cout<<" 報名時間已經截止 "; Go_back2(); } else { cout<<"輸入你的學生證號 :  "; cin >>Id ; strcpy(Cpy_path1,Path1) ; strcat(Cpy_path1,Id); strcat(Cpy_path1,".txt"); if(ScanRepetition(Cpy_path1) == -1) {  cout<<"沒有該學生信息"<<endl;  Go_back1(); }  if(ScanRepetition(Cpy_path1)==0 && Judge_IF_sign(Cpy_path1)) {  cout<<"該生已經報名,請勿重復報名"<<endl;  Go_back2(); } FILE *fIDCARD = fopen(Cpy_path1 ,"a+"); // 添加運動項目 if(!fIDCARD) {  cout<<"open the file "<<endl;  exit(0) ; } /*識別性別*/  rewind(fIDCARD); fscanf(fIDCARD,"%s %s %d %c %s %s %d %d %d %d %d %d ",Stu.IDcard ,Stu.name ,&Stu.age ,&Stu.gender ,Stu.Institute ,Stu.Class,  &Stu.Join_time.year ,&Stu.Join_time.month ,&Stu.Join_time.day ,&Stu.Join_time.hours ,&Stu.Join_time.minutes,&Stu.Join_time.second );  system("cls"); FILE *SPORT_IN_FILE = fopen("SPORT.txt","r"); if(!SPORT_IN_FILE) {  cout<<"SPORT_IN_FILE open ERROR"<<endl;  exit(0); } ch = fgetc(SPORT_IN_FILE); while(!feof(SPORT_IN_FILE)) {  putchar(ch);  ch = fgetc(SPORT_IN_FILE);  Sleep(5); } fclose(SPORT_IN_FILE); system("pause"); system("cls"); cout<<endl <<endl ; if (Stu.gender == 'm')// 如果是男的 { Per p[MAX] ; // num ; // name ; char t1[MAX] ,t2[MAX] ; FILE *sport = fopen("sportitemM.txt","r"); if(!sport) {  cout<<"sportitemM open ERROR"<<endl;  exit(0); } ih = fgetc(sport); while(!feof(sport)) {  putchar(ih);  ih = fgetc(sport);  Sleep(10); } fclose(sport); FILE *fin = fopen("M.txt","r");  cout<<endl; cout<<"選擇參加項目"<<endl; cout<<"每名運動員可任意選擇兩種項目 (選一種的選擇000)"<<endl; //cin >> M.sport_it1 >> M.sport_it2 ; cin >> t1 >> t2 ; int i = 0 ; int flag1 , flag2 ; while(!feof(fin)) {    fscanf(fin , "%s %s",p[i].num ,p[i].name);  i++ ; } int j = 0 ; while(j<=i) {  if (strcmp(t1 , p[j].num)==0)  {  flag1 = j ;   }  if (strcmp(t2 , p[j].num)==0)  {  flag2 = j ;  }  j++ ; }  strcpy(M.sport_it1 , p[flag1].name); strcpy(M.sport_it2 , p[flag2].name); fprintf(fIDCARD,"%s %s",M.sport_it1 ,M.sport_it2); rewind(fIDCARD); fscanf(fIDCARD,"%s %s %d %c %s %s %d %d %d %d %d %d %s %s",M.IDcard ,M.name ,&M.age ,&M.gender ,M.Institute ,M.Class,  &M.Join_time.year ,&M.Join_time.month ,&M.Join_time.day ,&M.Join_time.hours ,&M.Join_time.minutes,&M.Join_time.second, M.sport_it1,M.sport_it2);  cout<<"選擇成功"<<endl; printList_new(M); fclose(fIDCARD); Sleep(500); Go_back1(); } else if (Stu.gender == 'f') { Per p[MAX] ; char t1[MAX] ,t2[MAX] ; FILE *sport = fopen("sportitemF.txt","r"); if(!sport) {  cout<<"sportitemM open ERROR"<<endl;  exit(0); } ih = fgetc(sport); while(!feof(sport)) {  putchar(ih);  ih = fgetc(sport);  Sleep(10); } fclose(sport); FILE *fin = fopen("F.txt","r");  cout<<endl; cout<<"選擇參加項目"<<endl; cout<<"每名運動員可任意選擇兩種項目 (選一種的選擇000)"<<endl;  cin >> t1 >> t2 ; int i = 0 ; int flag1 , flag2 ; while(!feof(fin)) {   fscanf(fin , "%s %s",p[i].num ,p[i].name);  if (strcmp(t1 , p[i].num)==0)  {  flag1 = i ;   }  if (strcmp(t2 , p[i].num)==0)  {  flag2 = i ;  }  i++ ;  } strcpy(M.sport_it1 , p[flag1].name); strcpy(M.sport_it2 , p[flag2].name); fprintf(fIDCARD,"%s %s",M.sport_it1 ,M.sport_it2); rewind(fIDCARD); fscanf(fIDCARD,"%s %s %d %c %s %s %d %d %d %d %d %d %s %s",M.IDcard ,M.name ,&M.age ,&M.gender ,M.Institute ,M.Class,  &M.Join_time.year ,&M.Join_time.month ,&M.Join_time.day ,&M.Join_time.hours ,&M.Join_time.minutes,&M.Join_time.second, M.sport_it1,M.sport_it2);  cout<<"選擇成功"<<endl; printList_new(M); fclose(fIDCARD); Sleep(500); Go_back1();  }  }}  void Apply_Information_Query(){ // 報名信息查詢 ; int i ; char id_register[MAX] ; char Temp[MAX]; system("cls"); cout <<"請輸入學號 :"<<"  " ; cin>>id_register ; strcpy(Temp,Path1); strcat(id_register,".txt"); strcat(Temp,id_register); if(ScanRepetition(Temp)== -1 ) { cout<<"沒有該生的相關信息!"<<endl; Go_back1(); } if(Judge_IF_sign(Temp)== false) { cout<<"狀態 : 未報名"<<endl; } else cout<<"狀態 : 已報名"<<endl;  Go_back1();  return ;}void Athlete_Information(){ int i ; char id_register[MAX] ; char Temp[MAX]; system("cls"); cout <<"請輸入學號 :"<<"  " ; cin>>id_register ; strcpy(Temp,Path1); strcat(id_register,".txt"); strcat(Temp,id_register); if(ScanRepetition(Temp)== -1) { cout<<"沒有該生的相關信息!"<<endl; Go_back1(); } if(Judge_IF_sign(Temp)) { Point_Base_Me(Temp); Go_back1(); } else { cout<<"還沒報名哦 ,請現在報名才能查看哦 !"<<endl; Go_back1(); }  return ;}bool Judge_IF_sign(char *Path){ // 判斷學生是否已報名項目; bool flag = false ; char Temp[MAX] ; int count = 0; FILE *fp = fopen(Path ,"r") ; if(!fp) { cout<<"該生沒有錄入信息"<<endl; exit(0) ; } while(!feof(fp)) { count +=fscanf(fp,"%s",Temp);  } if (count == 14)// 如果已經報名; flag = true ; return flag ;}void Go_back1(){ char ch ; cout<<" 返回主頁面  "<<" [y/n] "; cin >>ch ; if(ch=='y') { system("cls"); ShowPage(); } else { cout<<"服務器錯誤00044xx"<<endl; exit(0); } return ;}void Go_back2(){ char ch ; cout<<" 返回上一級  "<<" [y/n] "; cin >>ch ; if(ch=='y') { system("cls"); Show_Apply_System(); } else { cout<<"服務器錯誤00044xx"<<endl; exit(0); } return ;  }void Go_back3(){  // 返回管理系統上一級; char ch ; cout<<" 返回上一級  "<<" [y/n] "; cin >>ch ; if(ch=='y') { system("cls"); show_in_AdSYstem(); } else { cout<<"服務器錯誤00044xx"<<endl; exit(0); }   return ;}void Go_back4(){ char ch ; cout<<" 返回上一級  "<<" [y/n] "; cin >>ch ; if(ch=='y') { system("cls"); Manage_system(); } else { cout<<"服務器錯誤00044xx"<<endl; exit(0); } return ;}void printList_new(Message &M){  cout<<"姓名 : " <<M.name <<endl; cout<<"學號 : " <<M.IDcard <<endl; cout<<"性別 : "<<M.gender<<endl; cout<<"年齡 : "<<M.age<<endl; cout<<"學院 : "<<M.Institute<<endl; cout<<"班級 : "<<M.Class<<endl; cout<<"報名項目 : "<<M.sport_it1 <<" "<<M.sport_it2 <<endl; cout<<"報名時間 : "<<M.Join_time.year<<"-"<<M.Join_time.month<<"-"<< M.Join_time.day <<" "<<M.Join_time.hours<<":"<<M.Join_time.minutes<<":"<<M.Join_time.second<<endl;  return ;}void Point_Base_Me(char *Temp){ FILE *fp = fopen(Temp,"r"); Message M ;  fscanf(fp,"%s %s %d %c %s %s %d %d %d %d %d %d %s %s",M.IDcard ,M.name ,&M.age ,&M.gender ,M.Institute ,M.Class, &M.Join_time.year ,&M.Join_time.month ,&M.Join_time.day ,&M.Join_time.hours ,&M.Join_time.minutes,&M.Join_time.second, M.sport_it1,M.sport_it2); printList_new(M); Go_back1(); return ;}void Administrator_System(){ // 管理員 ; // 加一個 管理員登錄 ; Enter_Adsystem(); }void show_in_AdSYstem(){ /* cout<<"您已進入管理員系統"<< endl; cout<<"請輸入管理員賬號和密碼"<<endl;*/ system("cls"); cout<<endl<<endl;  cout<<"/t/t/t  ***********************************"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t  管 理 員 系 統      *"<<endl ;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ☆"<<" 1 賬號注冊    ☆   *"<<endl; cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ☆"<<" 2 管理系統    ☆   *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ☆"<<" 3 返回上一頁   ☆   *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  ***********************************"<<endl; AD_Menu(); return ;}void AD_Menu(){   int num ;  cout<<endl;  cout<<"========================================================================"<<endl;  cout<<"功能選擇"<<endl;  if(scanf("%d",&num)) // 正常輸入  {    switch (num)    {      case 1:        {   Log_Administrator();  }        break ;      case 2:        {         Manage_system();                }        break ;  case 3:  {   system("cls");   ShowPage();  }  break ;      default :        {          cout<<"ERORR"<<endl;          exit(ERROR);        }    }   }   return ; }void Log_Administrator(){ // 賬號注冊 ; FILE *fp ; AD admin ; char Pass_word[MAX] ; char Temp[MAX] ; strcpy(Temp,Path2); cout<<"輸入姓名"<<" : "; cin>>admin.num ; strcat(Temp,admin.num); strcat(Temp,".txt"); cout<<endl; cout<<"輸入密碼"<<" : "; cin>>admin.password ; cout<<endl;OP: cout<<"重復密碼"<<" : "; cin>>Pass_word ;  if(strcmp(admin.password,Pass_word) == 0 ) {// 密碼正確 并且文件不存在 if(ScanRepetition(Temp)==0) {  cout<<"賬戶存在"<<endl;  exit(ERROR); } cout<<"注 冊 成 功"<<endl; fp = fopen(Temp,"w"); if(!fp) {  cout<<"open Temp failed "<<endl;  exit(ERROR) ; } fprintf(fp,"%s",admin.password);  fclose(fp); Go_back3(); } else { cout<<"密碼不一致"<<endl;  goto OP ; }  return ;}void Manage_system(){ system("cls"); cout<<endl<<endl;  cout<<"/t/t/t  ***********************************"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t  管 理 系 統       *"<<endl ;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ☆"<<" 1 運動員報名取消    *"<<endl; cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ☆"<<" 2 修改截止日期     *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  */t"<<" ☆"<<" 3 返回上一頁      *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  *                 *"<<endl;  cout<<"/t/t/t  ***********************************"<<endl; AD_Menu2();  return ;}void AD_Menu2(){ int num ;  cout<<endl;  cout<<"========================================================================"<<endl;  cout<<"功能選擇"<<endl;  if(scanf("%d",&num)) // 正常輸入  {    switch (num)    {      case 1:        {   // 運動員報名取消 刪除文件   Cancel_signup();     }        break ;      case 2:        {   // 修改截止日期;   Revise_Data();   Go_back3();        }        break ;  case 3:  {   show_in_AdSYstem();     }       default :        {          cout<<"ERORR"<<endl;          exit(ERROR);        }    }   }   return ;   }void Cancel_signup(){ // 報名取消; // 殺出文件 char id[MAX] ; // char Temp[MAX] ; cout<<" 輸入報名取消的運動員學號"<<"  :"; cin >> id ; strcpy(Temp,Path1); strcat(Temp,id); strcat(Temp,".txt"); if(ScanRepetition(Temp) == -1) { cout<<"沒有該運動員的信息,報名取消錯誤"<<endl; exit(0);  } else { remove(Temp); cout<<"刪除成功"<<endl;  } Go_back3(); return ; }void Revise_Data(){ // 修改日期 ; FILE *fp = fopen("Data.txt","w"); Data D ; cout<< "輸入年份"<<"  : "; cin >> D.year ; cout<<endl; cout<< "輸入月份"<<"  : "; cin >> D.month ; cout<<endl; cout<< "輸入天數"<<"  : "; cin >> D.day ; cout<<endl; cout<< "輸入小時"<<"  : "; cin >> D.hours ; cout<<endl; cout<< "輸入分鐘"<<"  : "; cin >> D.minutes ; cout<<endl; cout<< "輸入秒數"<<"  : "; cin >> D.second ; cout<<endl; fprintf(fp,"%d %d %d %d %d %d",D.year,D.month,D.day ,D.hours ,D.minutes ,D.second); cout<<"修改成功"<<endl; fclose(fp); return ;}void Enter_Adsystem(){ char name[MAX] ; char Temp[MAX] ; char Password[MAX] ; char PW[MAX] ; FILE *fp ; cout <<" 請輸入管理員賬號名 :  "; cin >> name ; cout<<endl; strcpy(Temp , Path2) ; strcat(Temp , name) ; strcat(Temp , ".txt"); if(ScanRepetition(Temp) == -1) { // 不存在 cout<<" 管理員賬號不存在 "<<endl ; exit(0) ; } fp = fopen(Temp , "r") ; if(!fp) { cout<<" open the file failed "<<endl; exit(0) ; } fscanf(fp , "%s",Password); fclose(fp) ; cout <<" 你輸入密碼驗證 "<<" : "; cin >> PW ; if ( strcmp(PW,Password)==0) { int i ;    cout<<"驗證成功"<<endl ;     for(i = 1 ; i<= 4 ; i++) {  cout <<i;  Sleep(500) ;  system("cls");  }    show_in_AdSYstem(); } else { cout <<"驗證失敗"<<endl; Go_back1(); }   return ;}bool Judge_IF_Past_due(){ Message M ; Data D ; // 截止時間 Data SD ; // 當前時間 ;// bool C = true ; // 初始值時過期了 FILE *Dp = fopen("Data.txt","r"); if(!Dp) { exit(0); } fscanf(Dp,"%d%d%d%d%d%d",&D.year,&D.month,&D.day ,&D.hours ,&D.minutes ,&D.second); //printf("截止時間 :%d -%d- %d %d :%d :%d /n",D.year,D.month,D.day ,D.hours ,D.minutes ,D.second); Gettime_f(SD.year ,SD.month ,SD.day ,SD.hours ,SD.minutes ,SD.second); //獲取當前時間 printf("當前時間  : [ %d -%d- %d %d :%d :%d  ]/n",SD.year ,SD.month ,SD.day ,SD.hours ,SD.minutes ,SD.second); if( SD.year < D.year ) {// 截止時間 :2019 -5- 47 8 :63 :12// 當前時間 :2018 -7- 11 15 :46 :24  return false ; // 還沒截止    } else if (SD.year == D.year && SD.month != D.month) { if(SD.month < D.month) {  return false ; } else if ( SD.month > D.month) {  return true ; }  } else if (SD.year == D.year && SD.month == D.month && SD.day != D.day) { if (SD.day <D.day ) {  // 如果當前天數 小于 截止天數  return false ; } else if ( SD.day > D.day) {  return true ; }   } else if ( SD.year == D.year && SD.month == D.month && SD.day == D.day && SD.hours !=D.hours) {  if (SD.hours <D.hours ) {   return false ; } else if ( SD.hours > D.hours) {  return true ; }  }  }

代碼有點多,應該還能改進,路徑可以自己改。
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持VEVB武林網。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
成人黄色影片在线| 色中色综合影院手机版在线观看| 欧美性猛交xxxx黑人猛交| 日韩精品免费在线| 国产成人精品一区二区| 午夜免费在线观看精品视频| 欧美激情久久久久| 久久久成人av| 欧美激情视频在线观看| 久久久91精品国产一区不卡| 日韩中文字幕在线观看| 国产日韩欧美日韩| 日韩在线观看免费全| 日韩欧美成人精品| 精品国产乱码久久久久久虫虫漫画| 国语自产精品视频在免费| 国产视频精品免费播放| 久久久久久久久久久免费| 亚洲精品自产拍| 亚洲精品电影在线观看| 91视频国产高清| 91精品一区二区| 精品露脸国产偷人在视频| 欧美在线视频一区二区| 日韩成人性视频| 久久综合电影一区| 久久免费少妇高潮久久精品99| 欧美性极品少妇精品网站| 懂色av中文一区二区三区天美| 日韩欧美视频一区二区三区| 中文字幕av一区| 久久国产精品免费视频| 911国产网站尤物在线观看| 欧美激情第1页| 操日韩av在线电影| 久久国产精品首页| 欧美色视频日本版| 成人精品在线观看| 亚洲欧美日韩中文在线制服| 久久99久久久久久久噜噜| 色偷偷av亚洲男人的天堂| 欧美午夜片在线免费观看| 国产精品久久婷婷六月丁香| 日本午夜精品理论片a级appf发布| 国产a∨精品一区二区三区不卡| 欧美激情乱人伦| 日韩av中文字幕在线播放| 日av在线播放中文不卡| 国产精品老牛影院在线观看| 日韩美女免费视频| 欧美日韩成人网| 久久福利网址导航| 日韩久久精品成人| 欧美精品久久久久久久久| www日韩欧美| 性金发美女69hd大尺寸| 亲子乱一区二区三区电影| 久久久久久久久久久国产| 久久91亚洲精品中文字幕奶水| 欧美激情手机在线视频| 一区二区国产精品视频| 亚洲免费电影在线观看| 精品国产乱码久久久久酒店| 欧美午夜片在线免费观看| 国产精品99久久久久久久久| 欧洲精品在线视频| 亚洲激情电影中文字幕| 欧洲中文字幕国产精品| 欧美性xxxx极品高清hd直播| 久热精品视频在线观看| 欧美激情久久久久久| 欧美性猛交xxxx免费看久久久| 亚洲国模精品一区| 久久理论片午夜琪琪电影网| 久久国产精品久久国产精品| 亚洲精品日韩在线| 中文欧美日本在线资源| 欧美黑人xxx| 美女少妇精品视频| 久久久免费精品视频| 日韩欧美aⅴ综合网站发布| 欧美激情a∨在线视频播放| 成人亚洲激情网| 欧美区在线播放| 国产九九精品视频| 日韩中文字幕网址| 日韩欧美综合在线视频| 国产99视频精品免视看7| 国内精品小视频| 欧美精品电影免费在线观看| 久99九色视频在线观看| 色天天综合狠狠色| 粉嫩av一区二区三区免费野| 最新69国产成人精品视频免费| 亚洲理论在线a中文字幕| 亚洲偷熟乱区亚洲香蕉av| 亚洲另类图片色| 欧美国产中文字幕| 精品爽片免费看久久| 91亚洲精品一区二区| 亚洲男人天堂2024| 亚洲自拍偷拍一区| www.日韩视频| 精品亚洲一区二区三区在线播放| 久久精品国产电影| 成人黄色片在线| 美日韩在线视频| 国产精品jvid在线观看蜜臀| 97人人模人人爽人人喊中文字| 成人在线播放av| 欧美一区二区色| 亚洲最大福利网| 欧美孕妇毛茸茸xxxx| 国产啪精品视频| 日韩高清av一区二区三区| 国产精品久久91| 在线观看免费高清视频97| 国产精品日日摸夜夜添夜夜av| 91性高湖久久久久久久久_久久99| 亚洲电影天堂av| 在线亚洲男人天堂| 欧美一区二三区| 亚洲精品成人免费| 国产精品aaa| 欧美黑人极品猛少妇色xxxxx| 日韩av不卡在线| 久久伊人色综合| 国产精品va在线播放我和闺蜜| 亚洲国产成人精品一区二区| 欧美一级成年大片在线观看| 欧美黑人一区二区三区| 亚洲free嫩bbb| 青草青草久热精品视频在线观看| 91产国在线观看动作片喷水| 成人欧美在线视频| 亚洲天堂av网| 日韩在线观看免费高清完整版| 在线看片第一页欧美| 麻豆精品精华液| 成人激情在线播放| 久久av红桃一区二区小说| 欧美洲成人男女午夜视频| 久久久欧美一区二区| 国产精品视频网站| 久久露脸国产精品| 欧美日本中文字幕| 欧美视频第一页| 亚洲日本aⅴ片在线观看香蕉| 18一19gay欧美视频网站| 国产成人亚洲精品| 亚洲国产精品成人精品| 欧美激情亚洲精品| 欧美性猛交视频| 日韩中文字幕在线视频播放| 精品久久久久久久久久国产| 中文欧美在线视频| 51ⅴ精品国产91久久久久久| 欧美麻豆久久久久久中文| 欧美日韩免费网站| 热99久久精品| 欧美色欧美亚洲高清在线视频| 91av在线免费观看| 日韩中文字幕在线免费观看| 国产精品成人观看视频国产奇米|