实验6

ex.1补足程序

#include 
#include  

const int N=5;

// 定义结构体类型struct student,并定义STU为其别名 
typedef struct student {
	long no;
	char name[20];
	int score; 	
}STU;

// 函数声明 
void input(STU s[], int n);
int findMinlist(STU s[], STU t[], int n);
void output(STU s[], int n);

int main() {
	STU stu[N], minlist[N];
	int count;
	
	printf("录入%d个学生信息\n", N);
	input(stu, N);
	
	printf("\n统计最低分人数和学生信息...\n");
	count = findMinlist(stu, minlist, N);
	
	printf("\n一共有%d个最低分,信息如下:\n", count);
	output(minlist, count);
	 
	system("pause");
	return 0;
} 

// 输入n个学生信息,存放在结构体数组s中 
void input(STU s[], int n) {
	int i;
	for(i=0; i 
 

实验6_第1张图片ex.2 补足代码2

#include 
#include  
#include 
const int N = 10;

// 定义结构体类型struct student,并定义其别名为STU 
typedef struct student {
	long int id;
	char name[20];
	float objective;	/*客观题得分*/
	float subjective;	/*操作题得分*/
	float sum;
	char level[10];	
}STU; 

// 函数声明
void input(STU s[], int n);
void output(STU s[], int n);
void process(STU s[], int n);

int main() {
	STU stu[N];
	
	printf("录入%d个考生信息: 准考证号,姓名,客观题得分(<=40),操作题得分(<=60)\n", N); 
	input(stu, N);
	
	printf("\n对考生信息进行处理: 计算总分,确定等级\n");
	process(stu, N);
	
	printf("\n打印考生完整信息: 准考证号,姓名,客观题得分,操作题得分,总分,等级\n");
	output(stu, N); 
	
	system("pause");
	return 0;
} 

// 录入考生信息:准考证号,姓名,客观题得分,操作题得分
void input(STU s[], int n) {
	int i;
    for(i=0;i 
 

实验6_第2张图片实验小结

第二个实验不太会编。  

  

你可能感兴趣的:(实验6)