score.h

来自「编写一程序」· C头文件 代码 · 共 69 行

H
69
字号
#ifndef _SCORE_H
#define _SCORE_H

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <conio.h>

#define N				10
#define STUDENT_COUNT	50		//学生数
#define LESSON_COUNT	3		//课程数

#define SUM_SORT				0
#define MATH_SORT				1
#define ENGLISH_SORT			2
#define COMPUTER_SORT			3
#define SUM_STATISTICS			4
#define MATH_STATISTICS			5
#define ENGLISH_STATISTICS		6
#define COMPUTER_STATISTICS		7
#define SEARCH					8

typedef struct _Student
{
	char id[N];					//学号
	char name[N];				//姓名
	int score[LESSON_COUNT];	//成绩
	int sum;					//总分
}Student;


//按课程成绩对学生进行排序
void Sort(Student *stu , int count , int lesson);

//求所有课程的总分
int Sum(int score[] , int count);

//按学号搜索某一名学生
int Search(Student stu[] , int count, char * studentId);//, Student * student);

//统计某门课程的不及格人数
int Statistics(int score[] , int n);

//显示信息
void ShowInfo(Student stu[] , int count);
//指导老师:GJH。     作者姓名:ZHG,学号:2005...。
void zhg_information()       
{
  int i;
  char ID[]="ID:2005...";
  clrscr();
//putchar('\n');
  for(i=1;i<=35;i++)
    putchar('-');
  printf("C  Program");
  for(i=1;i<=35;i++)
    putchar('-');
  putchar('\n');
  printf(" ... University\t\t\t\t\t ----Author:zhg\n");
  printf(" E-mail:wudazhg@163.com%56s\n",ID);
  for(i=1;i<=31;i++)
    putchar('=');
  printf("All Rights Reserved");
  for(i=1;i<=30;i++)
    putchar('=');
  putchar('\n');
}

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?