实验六

#include 
#include  

const int N=5;


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;
} 


void input(STU s[], int n) {
	int i;
	for(i=0; i 
 

  实验六_第1张图片

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


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 
 

  实验六_第2张图片

共用体与结构体类型区别:结构体可同时存储多种变量类型,共同体同一时间只能存储一种变量类型。

枚举类型用于描述      。

枚举变量使用过程中:

不能直接输入输出,可以把一个int型数值赋值给一个枚举类型的变量,反之不可以。

实验总结:第一个程序:写代码时思路是对的,由于对前面的部分知识运用的不够熟练,在写的过程中出现了一些错误。  

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