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

蟲蟲首頁| 資源下載| 資源專輯| 精品軟件
登錄| 注冊

Switch

Switch是交換機,它的前身是網橋。交換機是使用硬件來完成以往網橋使用軟件來完成過濾、學習和轉發過程的任務。Switch速度比HUB快,這是由于HUB不知道目標地址在何處,發送數據到所有的端口。而Switch中有一張轉發表,如果知道目標地址在何處,就把數據發送到指定地點,如果它不知道就發送到所有的端口。這樣過濾可以幫助降低整個網絡的數據傳輸量,提高效率。但然交換機的功能還不止如此,它可以把網絡拆解成網絡分支、分割網絡數據流,隔離分支中發生的故障,這樣就可以減少每個網絡分支的數據信息流量而使每個網絡更有效,提高整個網絡效率。目前有使用Switch代替HUB的趨勢。
  • 運動會源代碼

    #include <malloc.h>       #include <stdio.h>       #include <stdlib.h>       #include <string.h>       #define NULL 0      #define MaxSize 30          typedef struct athletestruct /*運動員*/     {         char name[20];          int score; /*分數*/         int range; /**/         int item; /*項目*/     }ATH;     typedef struct schoolstruct /*學校*/     {         int count; /*編號*/         int serial; /**/          int menscore; /*男選手分數*/         int womenscore; /*女選手分數*/         int totalscore; /*總分*/         ATH athlete[MaxSize]; /**/         struct schoolstruct *next;      }SCH;         int nsc,msp,wsp;      int ntsp;      int i,j;      int overgame;      int serial,range;      int n;      SCH *head,*pfirst,*psecond;      int *phead=NULL,*pafirst=NULL,*pasecond=NULL;     void create();         void input ()     {         char answer;          head = (SCH *)malloc(sizeof(SCH)); /**/         head->next = NULL;         pfirst = head;          answer = 'y';         while ( answer == 'y' )         {         Is_Game_DoMain:         printf("\nGET Top 5 when odd\nGET Top 3 when even");         printf("\n輸入運動項目序號 (x<=%d):",ntsp);         scanf("%d",pafirst);         overgame = *pafirst;         if ( pafirst != phead )         {             for ( pasecond = phead ; pasecond < pafirst ; pasecond ++ )             {                 if ( overgame == *pasecond )                 {                     printf("\n這個項目已經存在請選擇其他的數字\n");                     goto Is_Game_DoMain;                 }             }         }         pafirst = pafirst + 1;         if ( overgame > ntsp )         {             printf("\n項目不存在");             printf("\n請重新輸入");             goto Is_Game_DoMain;         }         Switch ( overgame%2 )         {         case 0: n = 3;break;         case 1: n = 5;break;         }         for ( i = 1 ; i <= n ; i++ )         {         Is_Serial_DoMain:         printf("\n輸入序號 of the NO.%d (0<x<=%d): ",i,nsc);                 scanf("%d",&serial);         if ( serial > nsc )          {             printf("\n超過學校數目,請重新輸入");             goto Is_Serial_DoMain;         }         if ( head->next == NULL )          {             create();         }         psecond = head->next ;          while ( psecond != NULL )          {             if ( psecond->serial == serial )             {                 pfirst = psecond;                 pfirst->count = pfirst->count + 1;                 goto Store_Data;             }             else             {                 psecond = psecond->next;             }         }         create();         Store_Data:                 pfirst->athlete[pfirst->count].item = overgame;         pfirst->athlete[pfirst->count].range = i;         pfirst->serial = serial;         printf("Input name:) : ");                 scanf("%s",pfirst->athlete[pfirst->count].name);         }         printf("\n繼續輸入運動項目(y&n)?");         answer = getchar();         printf("\n");         }     }         void calculate() /**/     {         pfirst = head->next;         while ( pfirst->next != NULL )         {             for (i=1;i<=pfirst->count;i++)             {                 if ( pfirst->athlete[i].item % 2 == 0 )                  {                     Switch (pfirst->athlete[i].range)                     {                     case 1:pfirst->athlete[i].score = 5;break;                     case 2:pfirst->athlete[i].score = 3;break;                     case 3:pfirst->athlete[i].score = 2;break;                     }                 }                 else                  {                     Switch (pfirst->athlete[i].range)                     {                     case 1:pfirst->athlete[i].score = 7;break;                     case 2:pfirst->athlete[i].score = 5;break;                     case 3:pfirst->athlete[i].score = 3;break;                     case 4:pfirst->athlete[i].score = 2;break;                     case 5:pfirst->athlete[i].score = 1;break;                     }                 }                 if ( pfirst->athlete[i].item <=msp )                  {                     pfirst->menscore = pfirst->menscore + pfirst->athlete[i].score;                 }                 else                  {                     pfirst->womenscore = pfirst->womenscore + pfirst->athlete[i].score;                 }             }             pfirst->totalscore = pfirst->menscore + pfirst->womenscore;             pfirst = pfirst->next;         }     }         void output()     {         pfirst = head->next;         psecond = head->next;         while ( pfirst->next != NULL )          {             // clrscr();              printf("\n第%d號學校的結果成績:",pfirst->serial);             printf("\n\n項目的數目\t學校的名字\t分數");             for (i=1;i<=ntsp;i++)              {                 for (j=1;j<=pfirst->count;j++)                  {                     if ( pfirst->athlete[j].item == i )                     {                                                                         printf("\n %d\t\t\t\t\t\t%s\n %d",i,pfirst->athlete[j].name,pfirst->athlete[j].score);break;                                             }                 }             }             printf("\n\n\n\t\t\t\t\t\t按任意建 進入下一頁");             getchar();             pfirst = pfirst->next;         }     //  clrscr();          printf("\n運動會結果:\n\n學校編號\t男運動員成績\t女運動員成績\t總分");         pfirst = head->next;         while ( pfirst->next != NULL )         {             printf("\n %d\t\t %d\t\t %d\t\t %d",pfirst->serial,pfirst->menscore,pfirst->womenscore,pfirst->totalscore);             pfirst = pfirst->next;         }         printf("\n\n\n\t\t\t\t\t\t\t按任意建結束");         getchar();     }         void create()     {                 pfirst = (struct schoolstruct *)malloc(sizeof(struct schoolstruct));         pfirst->next = head->next ;         head->next = pfirst ;                 pfirst->count = 1;         pfirst->menscore = 0;         pfirst->womenscore = 0;         pfirst->totalscore = 0;     }     void Save()     {FILE *fp;     if((fp = fopen("school.dat","wb"))==NULL)     {printf("can't open school.dat\n");     fclose(fp);     return;     }     fwrite(pfirst,sizeof(SCH),10,fp);     fclose(fp);     printf("文件已經成功保存\n");     }         void main()     {         system("cls");         printf("\n\t\t\t 運動會分數統計\n");         printf("輸入學校數目 (x>= 5):");         scanf("%d",&nsc);          printf("輸入男選手的項目(x<=20):");         scanf("%d",&msp);          printf("輸入女選手項目(<=20):");         scanf("%d",&wsp);          ntsp = msp + wsp;                  phead = (int *)calloc(ntsp,sizeof(int));         pafirst = phead;         pasecond = phead;         input();         calculate();          output();         Save();     }             

    標簽: 源代碼

    上傳時間: 2016-12-28

    上傳用戶:150501

  • c#簡單計算器

    // 學生管理.cpp : Defines the entry point for the application. // #include "stdafx.h" #include "resource.h" #define MAX_LOADSTRING 100 // Global Variables: HINSTANCE hInst; // current instance TCHAR szTitle[MAX_LOADSTRING]; // The title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text // Foward declarations of functions included in this code module: ATOM MyRegisterClass(HINSTANCE hInstance); BOOL InitInstance(HINSTANCE, int); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); struct person {   char name[10];   int ID;   int cj_yw;   int cj_sx;   struct person* next;   struct person* pro; }per; int APIENTRY WinMain(HINSTANCE hInstance,                      HINSTANCE hPrevInstance,                      LPSTR     lpCmdLine,                      int       nCmdShow) {   // TODO: Place code here. MSG msg; HACCEL hAccelTable; // Initialize global strings LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_MY, szWindowClass, MAX_LOADSTRING); MyRegisterClass(hInstance); // Perform application initialization: if (!InitInstance (hInstance, nCmdShow))  { return FALSE; } hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_MY); // Main message loop: while (GetMessage(&msg, NULL, 0, 0))  { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))  { TranslateMessage(&msg); DispatchMessage(&msg); } } return msg.wParam; } // //  FUNCTION: MyRegisterClass() // //  PURPOSE: Registers the window class. // //  COMMENTS: // //    This function and its usage is only necessary if you want this code //    to be compatible with Win32 systems prior to the 'RegisterClassEx' //    function that was added to Windows 95. It is important to call this function //    so that the application will get 'well formed' small icons associated //    with it. // ATOM MyRegisterClass(HINSTANCE hInstance) { WNDCLASSEX wcex; wcex.cbSize = sizeof(WNDCLASSEX);  wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = (WNDPROC)WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = hInstance; wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_MY); wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wcex.lpszMenuName = (LPCSTR)IDC_MY; wcex.lpszClassName = szWindowClass; wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL); return RegisterClassEx(&wcex); } // //   FUNCTION: InitInstance(HANDLE, int) // //   PURPOSE: Saves instance handle and creates main window // //   COMMENTS: // //        In this function, we save the instance handle in a global variable and //        create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) {    HWND hWnd;    hInst = hInstance; // Store instance handle in our global variable    hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);    if (!hWnd)    {       return FALSE;    }    ShowWindow(hWnd, nCmdShow);    UpdateWindow(hWnd);    return TRUE; } // //  FUNCTION: WndProc(HWND, unsigned, WORD, LONG) // //  PURPOSE:  Processes messages for the main window. // //  WM_COMMAND - process the application menu //  WM_PAINT - Paint the main window //  WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; TCHAR szHello[MAX_LOADSTRING]; LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING); Switch (message)  { case WM_COMMAND: wmId    = LOWORD(wParam);  wmEvent = HIWORD(wParam);  // Parse the menu selections: Switch (wmId) { case IDM_ABOUT:   DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);   break; case IDM_EXIT:   DestroyWindow(hWnd);   break; default:   return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // TODO: Add any drawing code here... RECT rt; GetClientRect(hWnd, &rt); DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER); EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam);    }    return 0; } // Mesage handler for about box. LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { Switch (message) { case WM_INITDIALOG: return TRUE; case WM_COMMAND: if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)  { EndDialog(hDlg, LOWORD(wParam)); return TRUE; } break; }     return FALSE; }

    標簽: 計算器 學生

    上傳時間: 2016-12-29

    上傳用戶:767483511

  • 簡單的計算器

    // 學生管理.cpp : Defines the entry point for the application. // #include "stdafx.h" #include "resource.h" #define MAX_LOADSTRING 100 // Global Variables: HINSTANCE hInst; // current instance TCHAR szTitle[MAX_LOADSTRING]; // The title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text // Foward declarations of functions included in this code module: ATOM MyRegisterClass(HINSTANCE hInstance); BOOL InitInstance(HINSTANCE, int); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); struct person {   char name[10];   int ID;   int cj_yw;   int cj_sx;   struct person* next;   struct person* pro; }per; int APIENTRY WinMain(HINSTANCE hInstance,                      HINSTANCE hPrevInstance,                      LPSTR     lpCmdLine,                      int       nCmdShow) {   // TODO: Place code here. MSG msg; HACCEL hAccelTable; // Initialize global strings LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_MY, szWindowClass, MAX_LOADSTRING); MyRegisterClass(hInstance); // Perform application initialization: if (!InitInstance (hInstance, nCmdShow))  { return FALSE; } hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_MY); // Main message loop: while (GetMessage(&msg, NULL, 0, 0))  { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))  { TranslateMessage(&msg); DispatchMessage(&msg); } } return msg.wParam; } // //  FUNCTION: MyRegisterClass() // //  PURPOSE: Registers the window class. // //  COMMENTS: // //    This function and its usage is only necessary if you want this code //    to be compatible with Win32 systems prior to the 'RegisterClassEx' //    function that was added to Windows 95. It is important to call this function //    so that the application will get 'well formed' small icons associated //    with it. // ATOM MyRegisterClass(HINSTANCE hInstance) { WNDCLASSEX wcex; wcex.cbSize = sizeof(WNDCLASSEX);  wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = (WNDPROC)WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = hInstance; wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_MY); wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wcex.lpszMenuName = (LPCSTR)IDC_MY; wcex.lpszClassName = szWindowClass; wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL); return RegisterClassEx(&wcex); } // //   FUNCTION: InitInstance(HANDLE, int) // //   PURPOSE: Saves instance handle and creates main window // //   COMMENTS: // //        In this function, we save the instance handle in a global variable and //        create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) {    HWND hWnd;    hInst = hInstance; // Store instance handle in our global variable    hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);    if (!hWnd)    {       return FALSE;    }    ShowWindow(hWnd, nCmdShow);    UpdateWindow(hWnd);    return TRUE; } // //  FUNCTION: WndProc(HWND, unsigned, WORD, LONG) // //  PURPOSE:  Processes messages for the main window. // //  WM_COMMAND - process the application menu //  WM_PAINT - Paint the main window //  WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; TCHAR szHello[MAX_LOADSTRING]; LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING); Switch (message)  { case WM_COMMAND: wmId    = LOWORD(wParam);  wmEvent = HIWORD(wParam);  // Parse the menu selections: Switch (wmId) { case IDM_ABOUT:   DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);   break; case IDM_EXIT:   DestroyWindow(hWnd);   break; default:   return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // TODO: Add any drawing code here... RECT rt; GetClientRect(hWnd, &rt); DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER); EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam);    }    return 0; } // Mesage handler for about box. LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { Switch (message) { case WM_INITDIALOG: return TRUE; case WM_COMMAND: if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)  { EndDialog(hDlg, LOWORD(wParam)); return TRUE; } break; }     return FALSE; }

    標簽: 學生 計算器

    上傳時間: 2016-12-29

    上傳用戶:767483511

  • AP2406技術手冊

    The AP2406 is a 1.5Mhz constant frequency, slope compensated current mode PWM step-down converter. The device integrates a main Switch and a synchronous rectifier for high efficiency without an external Schottky diode. It is ideal for powering portable equipment that runs from a single cell lithium-Ion (Li+) battery. The AP2406 can supply 600mA of load current from a 2.5V to 5.5V input voltage. The output voltage can be regulated as low as 0.6V. The AP2406 can also run at 100% duty cycle for low dropout operation, extending battery life in portable system. Idle mode operation at light loads provides very low output ripple voltage for noise sensitive applications. The AP2406 is offered in a low profile (1mm) 5-pin, thin SOT package, and is available in an adjustable version and fixed output voltage of 1.2V, 1.5V and 1.8V

    標簽: 2406 AP 技術手冊

    上傳時間: 2017-02-23

    上傳用戶:w124141

  • matlab流程語句

    程序流程語句 1、 if 語句 2、 Switch 語句 3、 while 語句 4、 for 語句 5、循環的嵌套 6、其他流程控制語句

    標簽: matlab 流程

    上傳時間: 2017-03-10

    上傳用戶:qlxxx

  • 學生成績管理

    #include<stdio.h> #include<windows.h> int xuanxiang; int studentcount; int banjihao[100]; int xueqihao[100][10]; char xm[100][100]; int xuehao[100][10]; int score[100][3]; int yuwen; int shuxue[000]; int yingyu[100]; int c[100]; int p; char x[1000][100]="",y[100][100]="";/*x學院 y專業 z班級*/  int z[100];  main() { void input(); void inputsc(); void alter(); void scbybannji(); printf("--------學生成績管理-----\n"); printf("請按相應數字鍵來實現相應功能\n"); printf("1.錄入學生信息   2.錄入學生成績       3.修改學生成績\n"); printf("4.查詢學生成績   5.不及格科目及名單   6.按班級輸出學生成績單\n"); printf("請輸入你要實現的功能所對應的數字:"); scanf("%d",&xuanxiang); system("cls"); getchar(); Switch (xuanxiang) { case 1:input(); case 2:inputsc(); case 3:alter(); /*case 4:select score(); case 5:bujigekemujimingdan();*/ case 6:scbybanji; } } void input() { int i; printf("請輸入你的學院名稱:"); gets(x); printf("請輸入你的專業名稱:"); gets(y); printf("請輸入你的班級號:"); scanf("%d",&z); printf("請輸入你們一個班有幾個人:"); scanf("%d",&p); system("cls"); for(i=0;i<p;i++) { printf("請輸入第%d個學生的學號:",i+1); scanf("%d",xuehao[i]); getchar(); printf("請輸入第%d個學生的姓名:",i+1); gets(xm[i]); system("cls"); } printf("您已經錄入完畢您的班級所有學生的信息!\n"); printf("您的班級為%s%s%s\n",x,y,z); /*alter(p);*/ } void inputsc() { int i; for(i=0;i<p;i++) { printf("\n"); printf("--------------------------------------------------------------------------------\n\n"); printf("\t\t\t\t錄入學生的成績\n\n\n"); printf("--------------------------------------------------------------------------------\n\n"); printf("\t\t\t\t%s\n",xm[i]); printf("\n"); printf("\t\t\t\t數學:"); scanf("%d",&shuxue[i]); printf("\n"); getchar(); printf("\t\t\t\t英語:"); scanf("%d",&yingyu[i]); printf("\n"); getchar(); printf("\t\t\t\tc語言:"); scanf("%d",&c[i]); system("cls"); } } void alter() { int i;/*循環變量*/ int m[10000];/*要查詢的學號*/ int b;/*修改后的成績*/ char kemu[20]=""; printf("請輸入你要修改的學生的學號"); scanf("%d",&m); for (i=0;i<p;i++) { if (m==xuehao[i]) { printf("%s的數學成績為%d,英語成績為%d,c語言成績為%d,xm[i],shuxue[i],yingyu[i],c[i]");  printf("請輸入你想修改的科目");} } gets(kemu); getchar(); if (kemu=="數學"); { scanf("%d",&b); shuxue[i]=b;} if (kemu=="英語"); { scanf("%d",&b); yingyu[i]=b;} if (kemu=="c語言"); { scanf("%d",&b); c[i]=b; } printf("%s的數學成績為%d,英語成績為%d,c語言成績為%d,xm[i],shuxue[i],yingyu[i],c[i]"); } void scbybannji() { int i; char zyname[20]; int bjnumber; printf("請輸入你的專業名稱"); scanf("%s",&zyname); printf("請輸入你的班級號"); scanf("%d",&bjnumber); for (i=0;i<p;i++) { if (zyname==y[i]); if (bjnumber==z[i]); printf("專業名稱%s班級號%d數學成績%d英語成績%dc語言成績%d,y[i],z[i],shuxue[i],yingyu[i],c[i]"); } }

    標簽: c語言

    上傳時間: 2018-06-08

    上傳用戶:2369043090

  • BTS50_datasheet

    The BTS5016SDA is a one channel high-side power Switch in PG-TO252-5-11 package providing embedded protective functions. The power transistor is built by a N-channel vertical power MOSFET with charge pump. The design is based on Smart SIPMOS chip on chip technology. The BTS5016SDA has a current controlled input and offers a diagnostic feedback with load current sense and a defined fault signal in case of overload operation, overtemperature shutdown and/or short circuit shutdown.

    標簽: datasheet BTS 50

    上傳時間: 2019-03-27

    上傳用戶:guaixiaolong

  • L9352B

    Description The L9352B is an integrated quad low-side power Switch to drive inductive loads like valves used in ABS systems. Two of the four channels are current regulators with current range from 0 mA to 2.25 A. All channels are protected against fail functions. They are monitored by a status output.

    標簽: L9352B

    上傳時間: 2019-03-27

    上傳用戶:guaixiaolong

  • 成績查詢系統

    #include<stdio.h> #include<string.h> #include<stdlib.h> #define N 100 int iNumOfStu=0; struct score   {   float math;   float english;   float computer;   }; struct student   {   int number;   char name[20];   struct score sco;   float average;   }; struct student stu[N]; void print_menu(void);//輸出菜單 void choosemenu(void);//菜單選擇 void input_student1(int);//輸入學生信息 void input_student2(void);//輸入總函數 void input_student3(int &,int);//判斷學號是否重復 void input_student4(int,int);//覆蓋原信息 void sort_student3(student s[],int);//按照英語成績排序 void sort_student4(student s[],int);//按照計算機成績排序 void sort_student2(student s[],int);//按照數學成績排序 void sort_student5(student s[],int);//按照平均成績排序 float input_score2(int);//計算學生平均成績 void print_student2(void);//顯示表頭 void print_student3(int);//顯示學生信息 void print_student1(int);//顯示全部學生資料 void sort_student1(void);//排序總函數 void menu(void);//菜單調度總函數 int search_student2(int);//按學號查詢學生信息并輸出 void search_student3(int);//按平均分最高查詢并輸出 void search_student1(void);//查詢總函數 void delete_student2(int,int);//刪除學生信息 void delete_student1(void);//刪除總函數 void change_student2(int);//修改學生資料 void change_student1(void);//修改總函數 void input_score3(int);//統計成績 void input_score1(void);//統計成績總函數 void print_help(void);//輸出幫助信息 void exit_student(void);//退出系統 void save_student(student *,int);//保存學生信息 void main()   {   menu();   } void save_student(student *s,int a)//保存學生信息   {   FILE *fp;     if((fp=fopen("d:\\學生信息.txt","wb"))==NULL)       {       printf("不能打開文件!\n");       }     else       {       printf("保存信息到D盤\n");       fprintf(fp,"本班所有學生具體信息如下:\r\n");       fprintf(fp,"  學號       姓名           數學成績       英語成績     計算機成績     平均成績\r\n");       for(int i=0;i<a;i++)         {         fprintf(fp,"%8d%12s%14.2f%14.2f%14.2f%14.2f\n",stu[i].number,stu[i].name,stu[i].sco.math,stu[i].sco.english,stu[i].sco.computer,stu[i].average);         fprintf(fp,"\r\n");         }       fclose(fp);       printf("信息保存成功!\n");       }   } void exit_student(void)//退出系統   {   exit(1);   } void print_help(void)//輸出幫助信息   {   printf("本系統所能容納的最大學生數為%d人\n學生信息保存在D盤根目錄下,保存文件為“學生信息.txt”。\n感謝使用!\n",N);   } void input_score1(void)//統計成績總函數   {   int c;   c=search_student2(iNumOfStu);   printf("學號:%d\n",stu[c].number);   printf("姓名:%s\n",stu[c].name);   input_score3(c);   printf("新成績錄入成功!\n");   stu[c].average=input_score2(c);   } void input_score3(int a)//統計成績   {   printf("數學新成績:");   scanf("%f",&stu[a].sco.math);   printf("英語新成績:");   scanf("%f",&stu[a].sco.english);   printf("計算機新成績:");   scanf("%f",&stu[a].sco.computer);   } void change_student2(int a)//修改學生資料   {   printf("學號:%d----修改為:",stu[a].number);   scanf("%d",&stu[a].number);   getchar();   printf("姓名:%s----修改為:",stu[a].name);   gets(stu[a].name);   printf("數學成績:%.2f----修改為:",stu[a].sco.math);   scanf("%f",&stu[a].sco.math);   printf("英語成績:%.2f----修改為:",stu[a].sco.english);   scanf("%f",&stu[a].sco.english);   printf("計算機成績:%.2f----修改為:",stu[a].sco.computer);   scanf("%f",&stu[a].sco.computer);   } void change_student1(void)//修改總函數   {   int c;   c=search_student2(iNumOfStu);   getchar();   printf("是否要修改此學生信息?(“y”代表是)");   char d;   scanf("%c",&d);   if(d=='y'||d=='Y')     {     change_student2(c);       stu[c].average=input_score2(c);     printf("信息修改成功!\n");     }   } void delete_student1(void)//刪除總函數   {   int c;   c=search_student2(iNumOfStu);   getchar();   printf("是否刪除此條記錄?(“y”代表是)");   char d;   scanf("%c",&d);   if(d=='y'||d=='Y')     {     delete_student2(c,iNumOfStu);     printf("記錄已刪除!\n");     }   } void delete_student2(int a,int b)//刪除學生信息   {   for(int i=a;i<b-1;i++)     {     stu[i]=stu[i+1];     }   --iNumOfStu;   } void search_student1(void)//查詢總函數   {   printf("1、按學號查詢\n2、按平均分最高查詢\n請選擇:");   int c;   scanf("%d",&c);   Switch(c)     {     case 1:       {       search_student2(iNumOfStu);       break;       }     case 2:       {       search_student3(iNumOfStu);       break;       }     default: break;     }   } void menu(void)//菜單調度總函數   {   print_menu();   choosemenu();   } void sort_student1(void)//排序總函數   {   printf("1、按數學成績排序\n2、按英語成績排序\n3、按計算機成績排序\n4、按平均成績排序\n請選擇:");   int c;   scanf("%d",&c);   Switch(c)     {     case 1:       {       sort_student2(stu,iNumOfStu);       break;       }     case 2:       {       sort_student3(stu,iNumOfStu);       break;       }     case 3:       {       sort_student4(stu,iNumOfStu);       break;       }     case 4:       {       sort_student5(stu,iNumOfStu);       break;       }     default: break;     }   } void print_student1(int a)//顯示全部學生資料   {   printf("本班所有學生具體信息如下\n");   print_student2();   for(int i=0;i<a;i++)     {     print_student3(i);     }   } void print_student3(int a)//顯示學生信息   {   printf("%8d%12s%14.2f%14.2f%14.2f%14.2f\n",stu[a].number,stu[a].name,stu[a].sco.math,stu[a].sco.english,stu[a].sco.computer,stu[a].average);   } void print_student2(void)//顯示表頭   {   printf("  學號       姓名           數學成績       英語成績     計算機成績     平均成績\n");   } void input_student4(int a,int b)//覆蓋原信息   {   stu[a]=stu[b-1];   --iNumOfStu;   } void input_student3(int &a,int b)//判斷學號是否重復   {   if(a!=0)     {     int i=0;     do       {       if(stu[a].number==stu[i].number)         {         printf("此學號代表的學生已錄入\n1、覆蓋原信息\n2、重新輸入\n請選擇:");         int c;         scanf("%d",&c);         Switch(c)           {           case 1:             {             input_student4(i,iNumOfStu);             a=iNumOfStu-1;             printf("信息已替換!\n");             break;             }           case 2:             {             printf("請重新輸入學生信息:\n");             input_student1(iNumOfStu-1);             break;             }           default: break;           }         break;         }       ++i;       }       while(i<b-1);     }   } void print_menu(void)//輸出菜單   {   printf("======歡迎來到學生信息管理系統======\n");   printf("      1、輸入學生資料\n");   printf("      2、刪除學生資料\n");   printf("      3、查詢學生資料\n");   printf("      4、修改學生資料\n");   printf("      5、顯示學生資料\n");   printf("      6、統計學生成績\n");   printf("      7、排序學生成績\n");   printf("      8、保存學生資料\n");   printf("      9、獲取幫助信息\n");   printf("      10、退出系統\n");   printf("====================================\n");   printf("請選擇:");   } void input_student2(void)//輸入總函數   {   char end;   printf("請輸入學生信息(在最后一個學生信息錄入完成后以“/”結束錄入):\n");   for(int i=0;(end=getchar())!='/';i++)     {     input_student1(i);     ++iNumOfStu;     input_student3(i,iNumOfStu);     }   for(int j=0;j<iNumOfStu;j++)     {     stu[j].average=input_score2(j);     }   } void input_student1(int a)//輸入學生信息   {   printf("學號:");   scanf("%d",&stu[a].number);   getchar();   printf("姓名:");   gets(stu[a].name);   printf("數學成績:");   scanf("%f",&stu[a].sco.math);   printf("英語成績:");   scanf("%f",&stu[a].sco.english);   printf("計算機成績:");   scanf("%f",&stu[a].sco.computer);   } float input_score2(int a)//計算學生平均成績   {   return (stu[a].sco.math+stu[a].sco.english+stu[a].sco.computer)/3;   } void search_student3(int a)//按平均分最高查詢并輸出   {   int max=0;   for(int i=0;i<a;i++)     {     if(stu[max].average<stu[i].average)       {       max=i;       }     }   print_student2();   print_student3(max);   } void sort_student2(student s[],int a)//按照數學成績排序   {   struct student temp;   for(int i=0;i<a-1;i++)     {     int max=i;     for(int j=i+1;j<a;j++)       if(stu[j].sco.math>stu[max].sco.math)         {         max=j;         }     if(max!=i)       {       temp=stu[max];       stu[max]=stu[i];       stu[i]=temp;       }     }   print_student2();   for(int k=0;k<a;k++)     {     print_student3(k);     }   } void sort_student3(student s[],int a)//按照英語成績排序   {   struct student temp;   for(int i=0;i<a-1;i++)     {     int max=i;     for(int j=i+1;j<a;j++)       if(stu[j].sco.english>stu[max].sco.english)         {         max=j;         }     if(max!=i)       {       temp=stu[max];       stu[max]=stu[i];       stu[i]=temp;       }     }   print_student2();   for(int k=0;k<a;k++)     {     print_student3(k);     }   } void sort_student4(student s[],int a)//按照計算機成績排序   {   struct student temp;   for(int i=0;i<a-1;i++)     {     int max=i;     for(int j=i+1;j<a;j++)       if(stu[j].sco.computer>stu[max].sco.computer)         {         max=j;         }     if(max!=i)       {       temp=stu[max];       stu[max]=stu[i];       stu[i]=temp;       }     }   print_student2();   for(int k=0;k<a;k++)     {     print_student3(k);     }   } void sort_student5(student s[],int a)//按照平均成績排序   {   struct student temp;   for(int i=0;i<a-1;i++)     {     int max=i;     for(int j=i+1;j<a;j++)       if(stu[j].average>stu[max].average)         {         max=j;         }     if(max!=i)       {       temp=stu[max];       stu[max]=stu[i];       stu[i]=temp;       }     }   print_student2();   for(int k=0;k<a;k++)     {     print_student3(k);     }   } int search_student2(int a)//按照學號查找學生并輸出   {   int num;   int c;   printf("請輸入要查詢的學號:");   scanf("%d",&num);   for(int i=0;i<a;i++)     {     if(num==stu[i].number)       {       c=i;       }     }   printf("此學生的信息是:\n");   print_student2();   print_student3(c);   return c;   } void choosemenu(void)//菜單選擇   {   int i;   scanf("%d",&i);   Switch(i)     {     case 1:       {       input_student2();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 2:       {       delete_student1();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 3:       {       search_student1();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 4:       {       change_student1();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 5:       {       print_student1(iNumOfStu);       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 6:       {       input_score1();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 7:       {       sort_student1();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 8:       {       save_student(stu,iNumOfStu);       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 9:       {       print_help();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 10:       {       exit_student();       }     default: break;     }   }         運行結果:                         源文件下載地址: http://115.com/file/clnq138g#一個簡單的學生成績管理系統.rar (請將此地址復制到瀏覽器地址欄中訪問下載頁面)  

    標簽: 成績查詢系統

    上傳時間: 2019-06-08

    上傳用戶:啊的撒旦

  • 學生成績guanli

    #include<stdio.h> #include<string.h> #include<stdlib.h> #define N 100 int iNumOfStu=0; struct score   {   float math;   float english;   float computer;   }; struct student   {   int number;   char name[20];   struct score sco;   float average;   }; struct student stu[N]; void print_menu(void);//輸出菜單 void choosemenu(void);//菜單選擇 void input_student1(int);//輸入學生信息 void input_student2(void);//輸入總函數 void input_student3(int &,int);//判斷學號是否重復 void input_student4(int,int);//覆蓋原信息 void sort_student3(student s[],int);//按照英語成績排序 void sort_student4(student s[],int);//按照計算機成績排序 void sort_student2(student s[],int);//按照數學成績排序 void sort_student5(student s[],int);//按照平均成績排序 float input_score2(int);//計算學生平均成績 void print_student2(void);//顯示表頭 void print_student3(int);//顯示學生信息 void print_student1(int);//顯示全部學生資料 void sort_student1(void);//排序總函數 void menu(void);//菜單調度總函數 int search_student2(int);//按學號查詢學生信息并輸出 void search_student3(int);//按平均分最高查詢并輸出 void search_student1(void);//查詢總函數 void delete_student2(int,int);//刪除學生信息 void delete_student1(void);//刪除總函數 void change_student2(int);//修改學生資料 void change_student1(void);//修改總函數 void input_score3(int);//統計成績 void input_score1(void);//統計成績總函數 void print_help(void);//輸出幫助信息 void exit_student(void);//退出系統 void save_student(student *,int);//保存學生信息 void main()   {   menu();   } void save_student(student *s,int a)//保存學生信息   {   FILE *fp;     if((fp=fopen("d:\\學生信息.txt","wb"))==NULL)       {       printf("不能打開文件!\n");       }     else       {       printf("保存信息到D盤\n");       fprintf(fp,"本班所有學生具體信息如下:\r\n");       fprintf(fp,"  學號       姓名           數學成績       英語成績     計算機成績     平均成績\r\n");       for(int i=0;i<a;i++)         {         fprintf(fp,"%8d%12s%14.2f%14.2f%14.2f%14.2f\n",stu[i].number,stu[i].name,stu[i].sco.math,stu[i].sco.english,stu[i].sco.computer,stu[i].average);         fprintf(fp,"\r\n");         }       fclose(fp);       printf("信息保存成功!\n");       }   } void exit_student(void)//退出系統   {   exit(1);   } void print_help(void)//輸出幫助信息   {   printf("本系統所能容納的最大學生數為%d人\n學生信息保存在D盤根目錄下,保存文件為“學生信息.txt”。\n感謝使用!\n",N);   } void input_score1(void)//統計成績總函數   {   int c;   c=search_student2(iNumOfStu);   printf("學號:%d\n",stu[c].number);   printf("姓名:%s\n",stu[c].name);   input_score3(c);   printf("新成績錄入成功!\n");   stu[c].average=input_score2(c);   } void input_score3(int a)//統計成績   {   printf("數學新成績:");   scanf("%f",&stu[a].sco.math);   printf("英語新成績:");   scanf("%f",&stu[a].sco.english);   printf("計算機新成績:");   scanf("%f",&stu[a].sco.computer);   } void change_student2(int a)//修改學生資料   {   printf("學號:%d----修改為:",stu[a].number);   scanf("%d",&stu[a].number);   getchar();   printf("姓名:%s----修改為:",stu[a].name);   gets(stu[a].name);   printf("數學成績:%.2f----修改為:",stu[a].sco.math);   scanf("%f",&stu[a].sco.math);   printf("英語成績:%.2f----修改為:",stu[a].sco.english);   scanf("%f",&stu[a].sco.english);   printf("計算機成績:%.2f----修改為:",stu[a].sco.computer);   scanf("%f",&stu[a].sco.computer);   } void change_student1(void)//修改總函數   {   int c;   c=search_student2(iNumOfStu);   getchar();   printf("是否要修改此學生信息?(“y”代表是)");   char d;   scanf("%c",&d);   if(d=='y'||d=='Y')     {     change_student2(c);       stu[c].average=input_score2(c);     printf("信息修改成功!\n");     }   } void delete_student1(void)//刪除總函數   {   int c;   c=search_student2(iNumOfStu);   getchar();   printf("是否刪除此條記錄?(“y”代表是)");   char d;   scanf("%c",&d);   if(d=='y'||d=='Y')     {     delete_student2(c,iNumOfStu);     printf("記錄已刪除!\n");     }   } void delete_student2(int a,int b)//刪除學生信息   {   for(int i=a;i<b-1;i++)     {     stu[i]=stu[i+1];     }   --iNumOfStu;   } void search_student1(void)//查詢總函數   {   printf("1、按學號查詢\n2、按平均分最高查詢\n請選擇:");   int c;   scanf("%d",&c);   Switch(c)     {     case 1:       {       search_student2(iNumOfStu);       break;       }     case 2:       {       search_student3(iNumOfStu);       break;       }     default: break;     }   } void menu(void)//菜單調度總函數   {   print_menu();   choosemenu();   } void sort_student1(void)//排序總函數   {   printf("1、按數學成績排序\n2、按英語成績排序\n3、按計算機成績排序\n4、按平均成績排序\n請選擇:");   int c;   scanf("%d",&c);   Switch(c)     {     case 1:       {       sort_student2(stu,iNumOfStu);       break;       }     case 2:       {       sort_student3(stu,iNumOfStu);       break;       }     case 3:       {       sort_student4(stu,iNumOfStu);       break;       }     case 4:       {       sort_student5(stu,iNumOfStu);       break;       }     default: break;     }   } void print_student1(int a)//顯示全部學生資料   {   printf("本班所有學生具體信息如下\n");   print_student2();   for(int i=0;i<a;i++)     {     print_student3(i);     }   } void print_student3(int a)//顯示學生信息   {   printf("%8d%12s%14.2f%14.2f%14.2f%14.2f\n",stu[a].number,stu[a].name,stu[a].sco.math,stu[a].sco.english,stu[a].sco.computer,stu[a].average);   } void print_student2(void)//顯示表頭   {   printf("  學號       姓名           數學成績       英語成績     計算機成績     平均成績\n");   } void input_student4(int a,int b)//覆蓋原信息   {   stu[a]=stu[b-1];   --iNumOfStu;   } void input_student3(int &a,int b)//判斷學號是否重復   {   if(a!=0)     {     int i=0;     do       {       if(stu[a].number==stu[i].number)         {         printf("此學號代表的學生已錄入\n1、覆蓋原信息\n2、重新輸入\n請選擇:");         int c;         scanf("%d",&c);         Switch(c)           {           case 1:             {             input_student4(i,iNumOfStu);             a=iNumOfStu-1;             printf("信息已替換!\n");             break;             }           case 2:             {             printf("請重新輸入學生信息:\n");             input_student1(iNumOfStu-1);             break;             }           default: break;           }         break;         }       ++i;       }       while(i<b-1);     }   } void print_menu(void)//輸出菜單   {   printf("======歡迎來到學生信息管理系統======\n");   printf("      1、輸入學生資料\n");   printf("      2、刪除學生資料\n");   printf("      3、查詢學生資料\n");   printf("      4、修改學生資料\n");   printf("      5、顯示學生資料\n");   printf("      6、統計學生成績\n");   printf("      7、排序學生成績\n");   printf("      8、保存學生資料\n");   printf("      9、獲取幫助信息\n");   printf("      10、退出系統\n");   printf("====================================\n");   printf("請選擇:");   } void input_student2(void)//輸入總函數   {   char end;   printf("請輸入學生信息(在最后一個學生信息錄入完成后以“/”結束錄入):\n");   for(int i=0;(end=getchar())!='/';i++)     {     input_student1(i);     ++iNumOfStu;     input_student3(i,iNumOfStu);     }   for(int j=0;j<iNumOfStu;j++)     {     stu[j].average=input_score2(j);     }   } void input_student1(int a)//輸入學生信息   {   printf("學號:");   scanf("%d",&stu[a].number);   getchar();   printf("姓名:");   gets(stu[a].name);   printf("數學成績:");   scanf("%f",&stu[a].sco.math);   printf("英語成績:");   scanf("%f",&stu[a].sco.english);   printf("計算機成績:");   scanf("%f",&stu[a].sco.computer);   } float input_score2(int a)//計算學生平均成績   {   return (stu[a].sco.math+stu[a].sco.english+stu[a].sco.computer)/3;   } void search_student3(int a)//按平均分最高查詢并輸出   {   int max=0;   for(int i=0;i<a;i++)     {     if(stu[max].average<stu[i].average)       {       max=i;       }     }   print_student2();   print_student3(max);   } void sort_student2(student s[],int a)//按照數學成績排序   {   struct student temp;   for(int i=0;i<a-1;i++)     {     int max=i;     for(int j=i+1;j<a;j++)       if(stu[j].sco.math>stu[max].sco.math)         {         max=j;         }     if(max!=i)       {       temp=stu[max];       stu[max]=stu[i];       stu[i]=temp;       }     }   print_student2();   for(int k=0;k<a;k++)     {     print_student3(k);     }   } void sort_student3(student s[],int a)//按照英語成績排序   {   struct student temp;   for(int i=0;i<a-1;i++)     {     int max=i;     for(int j=i+1;j<a;j++)       if(stu[j].sco.english>stu[max].sco.english)         {         max=j;         }     if(max!=i)       {       temp=stu[max];       stu[max]=stu[i];       stu[i]=temp;       }     }   print_student2();   for(int k=0;k<a;k++)     {     print_student3(k);     }   } void sort_student4(student s[],int a)//按照計算機成績排序   {   struct student temp;   for(int i=0;i<a-1;i++)     {     int max=i;     for(int j=i+1;j<a;j++)       if(stu[j].sco.computer>stu[max].sco.computer)         {         max=j;         }     if(max!=i)       {       temp=stu[max];       stu[max]=stu[i];       stu[i]=temp;       }     }   print_student2();   for(int k=0;k<a;k++)     {     print_student3(k);     }   } void sort_student5(student s[],int a)//按照平均成績排序   {   struct student temp;   for(int i=0;i<a-1;i++)     {     int max=i;     for(int j=i+1;j<a;j++)       if(stu[j].average>stu[max].average)         {         max=j;         }     if(max!=i)       {       temp=stu[max];       stu[max]=stu[i];       stu[i]=temp;       }     }   print_student2();   for(int k=0;k<a;k++)     {     print_student3(k);     }   } int search_student2(int a)//按照學號查找學生并輸出   {   int num;   int c;   printf("請輸入要查詢的學號:");   scanf("%d",&num);   for(int i=0;i<a;i++)     {     if(num==stu[i].number)       {       c=i;       }     }   printf("此學生的信息是:\n");   print_student2();   print_student3(c);   return c;   } void choosemenu(void)//菜單選擇   {   int i;   scanf("%d",&i);   Switch(i)     {     case 1:       {       input_student2();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 2:       {       delete_student1();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 3:       {       search_student1();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 4:       {       change_student1();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 5:       {       print_student1(iNumOfStu);       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 6:       {       input_score1();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 7:       {       sort_student1();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 8:       {       save_student(stu,iNumOfStu);       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 9:       {       print_help();       printf("按回車鍵返回主菜單");       getchar();       getchar();       menu();       break;       }     case 10:       {       exit_student();       }     default: break;     }   }         運行結果:                         源文件下載地址: http://115.com/file/clnq138g#一個簡單的學生成績管理系統.rar (請將此地址復制到瀏覽器地址欄中訪問下載頁面)   #include<stdio.h> #include<string.h> #include<stdlib.h> #define N 100 int iNumOfStu=0; struct score   {   float math;   float english;   float computer;   }; struct student   {   int number;   char name[20];   struct score sco;   float average;   }; struct student stu[N]; void print_menu(void);//輸出菜單 void choosemenu(void);//菜單選擇 void input_student1(int);//輸入學生信息 void input_student2(void);//輸入總函數 void input_student3(int &,int);//判斷學號是否重復 void input_student4(int,int);//覆蓋原信息 void sort_student3(student s[],int);//按照英語成績排序 void sort_student4(student s[],int);//按照計算機成績排序 void sort_student2(student s[],int);//按照數學成績排序 void sort_student5(student s[],int);//按照平均成績排序 float input_score2(int);//計算學生平均成績 void print_student2(void);//顯示表頭 void print_student3(int);//顯示學生信息 void print_student1(int);//顯示全部學生資料 void sort_student1(void);//排序總函數 void menu(void);//菜單調度總函數 int search_student2(int);//按學號查詢學生信息并輸出 void search_student3(int);//按平均分最高查詢并輸出 void search_student1(void);//查詢總函數 void delete_student2(int,int);//刪除學生信息 void delete_student1(void);//刪除總函數 void change_student2(int);//修改學生資料 void change_student1(void);//修改總函數 void input_score3(int);//統計成績 void input_score1(void);//統計成績總函數 void print_help(void);//輸出幫助信息 void exit_student(void);//退出系統 void save_student(student *,int);//保存學生信息 void main()   {   menu();   } void save_student(student *s,int a)//保存學生信息   {   FILE *fp;     if((fp=fopen("d:\\學生信息.txt","wb"))==NULL)       {       printf("不能打開文件!\n");       }     else       {       printf("保存信息到D盤\n");       fprintf(fp,"本班所有學生具體信息如下:\r\n");       fprintf(fp,"  學號       姓名           數學成績       英語成績     計算機成績     平均成績\r\n");       for(int i=0;i<a;i++)         {         fprintf(fp,"%8d%12s%14.2f%14.2f%14.2f%14.2f\n",stu[i].number,stu[i].name,stu[i].sco.math,stu[i].sco.english,stu[i].sco.computer,stu[i].average);         fprintf(fp,"\r\n");         }       fclose(fp);       printf("信息保存成功!\n");       }   } void exit_student(void)//退出系統   {   exit(1);   } void print_help(void)//輸出幫助信息   {   printf("本系統所能容納的最大學生數為%d人\n學生信息保存在D盤根目錄下,保存文件為“學生信息.txt”。\n感謝使用!\n",N);   } void input_score1(void)//統計成績總函數   {   int c;   c=search_student2(iNumOfStu);   printf("學號:%d\n",stu[c].number);   printf("姓名:%s\n",stu[c].name);   input_score3(c);   printf("新成績錄入成功!

    標簽: c語言

    上傳時間: 2019-06-09

    上傳用戶:啊的撒旦

主站蜘蛛池模板: 翁源县| 祁阳县| 洛宁县| 炎陵县| 清新县| 霍山县| 金秀| 英吉沙县| 江孜县| 郧西县| 衡阳市| 肃北| 乃东县| 浦县| 交口县| 新蔡县| 丽江市| 霸州市| 舒兰市| 长顺县| 贵港市| 揭东县| 高清| 长宁区| 广河县| 桦川县| 衡南县| 拉萨市| 纳雍县| 达州市| 淳安县| 锡林浩特市| 隆回县| 天镇县| 新源县| 团风县| 循化| 九龙县| 东丽区| 佳木斯市| 台江县|