亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? xueshengxinxiguanlixitong.txt

?? 學生信息管理系統,不知你合適不>下來看看啦,是我大三時候弄的~
?? TXT
字號:


 #include   /*標準輸入輸出庫*/
#include   /*字符串操作庫*/
#include   /*控制臺函數庫*/
#include   /*內存分配庫*/
#include   /*進程庫*/

#define   INITSIZE 100  /*初始化學生記錄的條數*/
#define   INCSIZE  sizeof(student) /*初始化空間不足時,增加存儲空間的字節數*/


typedef struct
{
 long no;  /*學生序號*/
 int math;  /*數學成績*/
 int program;  /*程序設計成績*/
 int amount;  /*總分*/
 char name[ 30 ];  /*學生姓名*/
}student;  /*學生結構體*/

int maxsize = INITSIZE; /*初始化記錄條數*/
int num =0;  /*當前學生記錄條數*/
int dbnull = 1;  /*數據庫是否存在的標志*/

 

 

enum   /*查詢,排序方式,五種*/
{
 No,   /*學號方式*/
 Name,   /*姓名方式*/
 Math,   /*數學成績方式*/
 Program,  /*程序設計成績方式*/
 Amount   /*總分方式*/
};

 

/*以下為所有函數的聲明*/
int createset(student **t);
void addnew(student *t);
void deletestu(student *t);
void stuselect(student *t,int mode);
void scoresort(student *t,int mode);
int findno(student *t,int no);
int findmath(student *t,int math);
int findprogram(student *t,int program);
int findamount(student *t,int amount);
int findname(student *t,const char *name);
void display(student *t,int no);
void mathsort(student *t);
void programsort(student *t);
void amountsort(student *t);
void swap(student *t, int i,int j);

/*以下為函數實現*/
int createset(student **t)/*創建數據記錄集*/

{
 char ask ;

 

 if (num!=0)  /*存在學生記錄*/
 {
  printf("Exsist a data base ,recover it?(Y/N)?");
  ask =getch();  /*是否覆蓋數據庫*/
  if (ask == 'y'||ask=='Y')
  {
   free(*t);  /*若選擇覆蓋,則釋放現存存儲空間,學生記錄個數清零*/
   num = 0;
  }
  else
  {
   return 0;  /*不選擇覆蓋,則退出*/
  }
 }

 


 *t = (student *)malloc(INITSIZE*sizeof(student)); /*分配INITSIZE個學生記錄所需空間*/

 if (!t)
 {
  printf("Memory overflow program abort.");  /*內存不足,退出程序*/
  exit(0);
 }


 else
 {
  printf("New database have been created.\n");  /*分配成功,成功創建數據庫*/
  dbnull = 0;      /*數據庫存在標志設為0(表示存在)*/
  return 1;
 }


}

void addnew(student *t)  /*向數據庫插入學生記錄*/
{
 student temp;

 if (dbnull)      /*數據庫存在標志不為0,即無數據庫,操作失敗*/
 {
     printf("Not exsist database select menu 1 to create database...");
     return;
 }
 if (num+1>maxsize)     /*當前記錄個數大于初始化記錄條數,追加空間*/
 {
  t =(student *)realloc(t,maxsize+INCSIZE);  /*追加一個記錄所需空間*/
  if (!t)      /*內存不足,追加失敗*/
  {
   printf("Memory overflow! program abort.\n");
   exit(0);
  }
 }

 printf("Input the student's No. , name, math score and program score that you want to add.\n");

 if (scanf("%ld%s%d%d",&(temp.no),   /*輸入學生數據*/
  temp.name,
  &(temp.math),
  &(temp.program)))
 {
  if (findno(t,temp.no) == -1)    /*查找輸入的學號是否與數據庫的重復*/
  {
   t[ num ].no = temp.no;     /*學號不沖突,則把輸入的記錄存放到數據庫末端*/
   strcpy(t[ num ].name,temp.name);

   t[ num ].math = temp.math;
   t[ num ].program = temp.program;

   t[ num ].amount = t[ num ].math + t[ num ].program;
   num++;      /*當前記錄數加一*/

   printf("Add sucess!\n");
  }

  else
  {
   printf("Exsist the student whom NO. is %d,add fail.\n",temp.no);/*輸入學號已經存在,添加記錄失敗*/
  }
 }

 else
 {
  printf("Data format error,add fail.\n");  /*輸入函數出錯,表示輸入格式錯誤,添加失敗*/
 }

}

 


void deletestu(student *t) /*從數據庫刪除某條學生記錄*/
{

 long delno =0;

 int index;

 int i =0;


 if (dbnull)  
 {
     printf("Not exsist database select menu 1 to create database...");
     return;
 }

 printf("Input the student NO. that you want to delete :\n");

 scanf("%ld",&delno);   /*輸入要刪除的學生的學號*/

 index = findno(t,delno);  /*按學號方式查找該學生是否存在*/

 if (index != -1)   /*該學生存在,則刪除他*/
 {

  for (i = index+1; i<= num; i++) /*數據庫記錄前移,完成'刪除'操作*/
  {

   t[ i-1 ].no = t[ i ].no;
   strcpy(t[ i-1 ].name,t[ i ].name);
   t[ i-1 ].math = t[ i ].math;
   t[ i-1 ].program = t[ i ].program;
   t[ i-1 ].amount = t[ i ].amount;

  }
  num--;    /*當前記錄數減一*/

  printf("Delete success!\n");

 }

 else
 {
  printf("The NO. that you input not exsist delete fail\n"); /*無該學號的學生,刪除失敗*/
 }

 

}


void stuselect(student *t,int mode)  /*搜索數據庫*/
{
 long  tempno =0;
 char tempname[ 30 ];
 int  tempmath;
 int  tempprogram;
 int  tempamount;
 int  count =0;

 if (dbnull)
 {
     printf("Not exsist database select menu 1 to create database...");
     return;
 }

 switch (mode)   /*判斷查詢方式*/
 {
 case No:   /*按學號查詢*/
  printf("Input the student NO. that you want to search.\n");
  scanf("%ld",&tempno);  /*輸入學號*/
  tempno =findno(t,tempno); /*查找該學生*/

  if ( tempno!= -1 )
  {
   printf("Search sucess!.\n");/*查詢成功,打印之*/
   display(t,tempno);
  }
  else
  {
   printf("The NO. that you input not exsist search fail.\n"); /*查找失敗*/
  }
  break;
 case Name:   /*按姓名查詢*/
  printf("Input the student name that you want to search.:\n");
  *tempname ='\0';
  scanf("%s",tempname);
  count = findname(t,tempname);  /*返回查詢姓名為name的學生記錄個數*/
  printf("There are %d student have been searched.\n",count);
  break;
 case Math:    /*按數學成績查詢*/
  printf("Input the a score, program will search students which math scores are higher than it.\n");
  scanf("%d",&tempmath);
  count = findmath(t,tempmath);
  printf("There are %d student have been searched.\n",count);
  break;

 case Program:   /*按程序設計成績查詢*/

  printf("Input the a score, program will search students which programming scores are higher than it.\n");
  scanf("%d",&tempprogram);
  count = findprogram(t,tempprogram);
  printf("There are %d student have been searched.\n",count);
  break;

 case Amount:   /*按總分查詢*/
  printf("Input the a score, program will search students which sum scores are higher than it\n");
  scanf("%d",&tempamount);
  count = findamount(t,tempamount);
  printf("There are %d student have been searched.\n",count);
  break;
 default:
  break;

 }

}


void scoresort(student *t,int mode) /*學生記錄排序*/
{
 int count =0;   

 switch (mode)  /*選擇不同排序方式進行成績排序*/
 {
 case Math:
  mathsort(t);  /*按數學成績排序*/
  break;
 case Program:  /*按程序設計成績排序*/
  programsort(t);
  break;
 case Amount:  /*按總分排序*/
  amountsort(t);
  break;
 }

 printf("Sorting have been finished .flowing is the result:\n");
 for (count =0;count< num; count++) /*排序完成后輸出排序結果*/
 {
  display(t,count);
 }
}


int findno(student *t,int no)/*按學號查找學生記錄*/
{
 int count =0;
 for (count =0; count {
  if ((t+count)->no == no) /*逐個搜索,若該學生記錄的學號等于需要查找的學號,則返回該學號*/
  {
   return count;
  }
 }
 return -1;   /*搜索完畢,仍沒有匹配學號,則返回-1*/
}


int findmath(student *t,int math)
{
 int count =0;   /*按數學成績查找,這里查找的結果是大于指定數學分數的所有學生記錄*/
 int i =0;
 for (count =0; count {
  if ((t+count)->math > math)
  {
   display (t,count);  /*顯示查找結果*/
   i++;
  }
 }

 return i;   /*返回符合查詢條件的學生記錄數目*/
}


int findprogram(student *t,int program)/*按程序設計成績查找學生記錄,算法類似上面的模塊*/
{
 int count =0;
 int i =0;
 for (count =0; count {
  if ((t+count)->program > program)
  {
   display(t,count);
   i++;
  }
 }

 return i;
}

int findamount(student *t,int amount)/*類似上面的模塊*/
{
 int count =0;
 int i =0;
 for (count =0; count {
  if ((t+count)->amount > amount)
  {
   display(t,count);
   i++;
  }
 }

 return i;
}


int findname(student *t,const char *name) /*類似上面的模塊*/
{
 int count =0;
 int i =0;
 for (count =0; count {
  if (!strcmp((t+count)->name,name))
  {
   display(t,count);
   i++;
  }
 }

 return i;
}


void display(student *t,int no)   /*打印指定學生記錄*/
{
 printf("NO.: %2ld  Name:%10s  Math : %2d Programing: %2d  Sum: %3d .\n",
  t[ no ].no,
  t[ no ].name,
  t[ no ].math,
  t[ no ].program,
  t[ no ].amount);
}


void mathsort(student *t)  /*數學成績排序,使用選擇排序算法*/
{


 int i;
 int j;


 for ( i =0; i< num-1; i++)
  for ( j =i+1; j  {
   if ( t[ j ].math > t[ i ].math )
   {
    swap(t,j,i);
   }
  }
}

void programsort(student *t)  /*類似數學成績排序*/
{


 int i;
 int j;


 for ( i =0; i< num-1; i++)
  for ( j =i+1; j  {
   if ( t[ j ].program > t[ i ].program )
   {
    swap(t,j,i);
   }
  }
}

void amountsort(student *t)  /*類似數學成績排序*/
{


 int i;
 int j;


 for ( i =0; i< num-1; i++)
  for ( j =i+1; j  {
   if ( t[ j ].amount > t[ i ].amount )
   {
    swap(t,j,i);
   }
  }
}


void swap(student *t, int i,int j) /*交換兩個學生的記錄內容*/
{
 student temp;    /*定義一個中間記錄*/
 
 temp.no = t[ j ].no;   /*逐個交換記錄的數據項*/
 t[ j ].no = t[ i ].no;
 t[ i ].no = temp.no;

 
 strcpy(temp.name , t[ j ].name);
 strcpy(t[ j ].name , t[ i ].name);
 strcpy(t[ i ].name , temp.name);


 temp.math = t[ j ].math;
 t[ j ].math = t[ i ].math;
 t[ i ].math = temp.math;

 temp.program = t[ j ].program;
 t[ j ].program = t[ i ].program;
 t[ i ].program = temp.program;

 temp.amount = t[ j ].amount;
 t[ j ].amount = t[ i ].amount;
 t[ i ].amount = temp.amount;
}

void main() /*Main module   主控模塊*/
{

 student *t;  /*定義整個程序學生記錄數據塊,用指針t標識*/

 int Menu =0,submenu =0;/*表示菜單項,主菜單,子菜單*/

 printf("\n\t\t********Students information manage system.********\n");
 while ( Menu!= '6' ) /*選擇菜單若為'6':(退出項),則退出菜單選擇*/
 {

  fflush(stdin); /*清除輸入緩沖區*/
  submenu =0;  /*重置子菜單的選中項*/
  printf("\
\n\
1>.New database.\n\
2>.Add data record.\n\
3>.Delete data record.\n\
4>.Sort.\n\
5>.Search.\n\
6>.Exit\n");

  printf("\nInput the menu's command...\n");
  Menu = getchar();  /*選擇菜單*/

  switch (Menu)   /*按選擇的菜單項,執行相應模塊*/
  {
  case '1':
   createset(&t);
   break;
  case '2':
   addnew(t);
   break;
  case '3':
   deletestu(t);
   break;
  case '4':
  if (dbnull)  /*數據庫不存在,不予以處理*/
 {
     printf("Not exsist database select menu 1 to create database...");
     break;
 }

   while (submenu != '4' )/*進入排序方式的子菜單*/
   {
    fflush(stdin);
    printf("\t****Score sort****\n\
 1>.Math score sort.\n\
 2>.Programming score sort.\n\
 3>.Sum score sort.\n\
 4>.Return to main menu.\n");
    printf("\n\tInput the menu's command...\n");
    submenu = getchar();

    switch ( submenu )
    {

    case '1':
     scoresort(t,Math);
     break;
    case '2':
     scoresort(t,Program);
     break;
    case '3':
     scoresort(t,Amount);
     break;
    case '4':
     break;
    default:
     break;
    }

   }
   break;
  case '5':

  if (dbnull)
  {
     printf("Not exsist database select menu 1 to create database...");
     break;
  }
   while (submenu != '6') /*進入查詢子菜單*/
   {
    fflush(stdin);

    printf("\t****Student search.*****\n\
 1>NO. search.\n\
 2>Name search.\n\
 3>Math score search.\n\
 4>Programming score search.\n\
 5>Sum score search.\n\
 6>Return to main menu.\n");


    printf("\n\tInput the menu command...\n");
    submenu = getchar();

    switch (submenu)
    {
    case '1':
     stuselect(t,No);
     break;
    case '2':
     stuselect(t,Name);
     break;
    case '3':
     stuselect(t,Math);
     break;
    case '4':
     stuselect(t,Program);
     break;
    case '5':
     stuselect(t,Amount);
     break;
    case '6':
     break;
    default:
     break;
    }

   }

  case '6':
   break;
  default:
   break;
  }


 }

 free(t);/*釋放數據庫所占空間*/

 printf("End ************Student information manage system*****\n");

 printf("\t\t\t\t\t\tPress any key to exit...");
 fflush(stdin);
 getch();  /*按任意鍵返回*/
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区免费看| 日本成人中文字幕| 日韩写真欧美这视频| 成人性色生活片| 亚洲国产人成综合网站| 日本一二三不卡| 欧美一区二区福利在线| 91亚洲午夜精品久久久久久| 国产综合一区二区| 婷婷综合另类小说色区| 日韩毛片在线免费观看| 久久精品亚洲国产奇米99| 欧美日韩国产综合久久| 91老司机福利 在线| 国产不卡在线一区| 狠狠色丁香久久婷婷综合_中| 首页亚洲欧美制服丝腿| 国产精品电影一区二区| 欧美成人女星排行榜| 欧美日韩一区二区在线观看 | 欧美探花视频资源| www.亚洲国产| 成人一区在线看| 国产一区二区三区在线观看免费视频 | 国产精品你懂的在线| 精品国产免费一区二区三区四区 | 久久er99热精品一区二区| 亚洲国产精品麻豆| 一区二区三区欧美日韩| 亚洲欧美日韩国产综合在线| 中文字幕欧美一| 国产精品毛片高清在线完整版| 成人免费精品视频| 精品一区精品二区高清| 蜜臀久久99精品久久久久久9| 久久久国产精品午夜一区ai换脸| 成人午夜精品在线| 国产一区二区精品在线观看| 美女尤物国产一区| 蜜桃av一区二区| 久热成人在线视频| 国产一区在线不卡| 粉嫩蜜臀av国产精品网站| 国产盗摄一区二区| 成人综合婷婷国产精品久久| 成人黄色国产精品网站大全在线免费观看| √…a在线天堂一区| 亚洲三级小视频| 亚洲视频在线一区观看| 亚洲日穴在线视频| 亚洲一二三四在线| 日韩国产欧美在线播放| 麻豆精品视频在线| 国产精品18久久久久久久久久久久| 一区二区三国产精华液| 亚洲自拍偷拍麻豆| 青青草国产成人av片免费| 毛片不卡一区二区| 国产激情一区二区三区四区| 不卡的av电影| 欧美性一二三区| 欧美一区二区三区小说| 久久夜色精品国产欧美乱极品| 欧美色欧美亚洲另类二区| 欧美精品久久99久久在免费线| 成人高清在线视频| 99热在这里有精品免费| 欧美日韩国产另类一区| 精品福利视频一区二区三区| 国产精品久久三| 亚洲成在人线免费| 国产一区二区在线影院| 91小视频在线| 日韩欧美在线影院| 国产精品剧情在线亚洲| 亚洲电影在线播放| 国产一区二区不卡老阿姨| 94色蜜桃网一区二区三区| 欧美日韩中文精品| 国产午夜精品福利| 午夜精品久久久久久久久久久| 亚洲男人电影天堂| 玖玖九九国产精品| 91黄色免费版| 久久久久久久av麻豆果冻| 一区二区三区在线观看网站| 麻豆精品一二三| 日本精品一级二级| 精品久久久三级丝袜| 最近中文字幕一区二区三区| 亚洲高清免费观看高清完整版在线观看| 亚洲国产精品ⅴa在线观看| 亚洲久草在线视频| 激情文学综合插| 在线观看一区二区精品视频| 久久噜噜亚洲综合| 亚洲mv在线观看| 成人高清免费观看| 26uuu亚洲综合色| 亚洲不卡av一区二区三区| 成人免费高清在线观看| 精品国产伦一区二区三区观看方式| 欧美mv日韩mv国产网站| 亚洲一卡二卡三卡四卡| www.亚洲免费av| 久久综合久久综合久久| 日韩影院精彩在线| 欧美影片第一页| 亚洲三级在线免费观看| 国产成人三级在线观看| 日韩视频不卡中文| 亚洲国产精品一区二区尤物区| 午夜电影一区二区三区| 91在线观看成人| 国产欧美日韩三区| 国产乱国产乱300精品| 精品人在线二区三区| 日韩精品一二三四| 欧美老肥妇做.爰bbww| 亚洲日本一区二区| 高清国产一区二区三区| 欧美成人在线直播| 蜜桃视频在线观看一区| 欧美日韩亚州综合| 亚洲成人动漫一区| 精品视频在线免费观看| 亚洲一区二区3| 欧美三片在线视频观看| 亚洲高清免费观看高清完整版在线观看| 日韩国产欧美在线视频| 91豆麻精品91久久久久久| 中文字幕亚洲欧美在线不卡| 成人免费观看av| 国产精品福利影院| 不卡视频在线看| 中文字幕一区二区三中文字幕| 亚洲gay无套男同| 欧美精品在线一区二区| 亚洲h在线观看| 欧美人狂配大交3d怪物一区 | 一区二区三区.www| 91亚洲精华国产精华精华液| 国产精品免费视频一区| aaa国产一区| 日韩毛片在线免费观看| 在线观看一区二区精品视频| 亚洲国产精品久久久久婷婷884| 国产原创一区二区三区| 欧美国产97人人爽人人喊| 成人免费看黄yyy456| 亚洲色图都市小说| 欧美图片一区二区三区| 午夜av一区二区三区| 7777女厕盗摄久久久| 激情综合色丁香一区二区| 久久久不卡影院| 成人综合激情网| 蜜桃av噜噜一区二区三区小说| 99久久婷婷国产综合精品电影 | 中文字幕在线观看一区二区| 99久久精品国产毛片| 亚洲色图欧洲色图婷婷| 欧美日韩综合色| 狠狠色狠狠色综合| 亚洲色图制服丝袜| 欧美美女喷水视频| 国产精品123区| 亚洲最新视频在线观看| 精品日韩欧美在线| 99国产精品国产精品毛片| 亚洲超丰满肉感bbw| 久久久欧美精品sm网站| 91麻豆免费在线观看| 丝袜美腿亚洲色图| 国产欧美一区二区精品婷婷| 91丨九色丨蝌蚪丨老版| 日本少妇一区二区| 国产精品视频观看| 7777精品伊人久久久大香线蕉的 | 精品亚洲成a人在线观看| 亚洲欧美在线高清| 日韩写真欧美这视频| av福利精品导航| 久久爱另类一区二区小说| 亚洲国产岛国毛片在线| 欧美午夜精品久久久| 国产一区在线精品| 性做久久久久久免费观看欧美| 欧美美女网站色| av网站免费线看精品| 蜜桃精品视频在线| 1000精品久久久久久久久| 精品精品国产高清a毛片牛牛| 激情国产一区二区 | 亚洲欧洲日韩综合一区二区| 日韩情涩欧美日韩视频| 欧美综合一区二区三区| 国产91精品欧美| 久久福利视频一区二区| 亚洲一二三区视频在线观看|