文章

49

粉丝

117

获赞

27

访问

15.2k

头像
学生成绩管理 题解:上机前最后一个题解
P1052
发布于2024年3月28日 15:34
阅读数 114

#include <iostream>
#include <string.h>
#include <math.h>
#include <algorithm>
using namespace std;
typedef struct student{
	char num[100];
	char class1[20];
	char name[20];
	double a;
	double b;
	double c;
	double sum;
	struct student *next;
}*student1;
void cc(student1 s,int n){
	student1 max=s;
	int mm=-1;
	for(int i=0;i<n;i++){
		if(s==NULL)
			break;
		if(s->sum>mm)
		{  mm=s->sum;
		  max=s;

		}
		s=s->next;
	}
	cout << max->num <<' '<<max->class1<<' '<<max->name;
	printf(" %.1f",max->a);
	printf(" %.1f",max->b);
	printf(" %.1f",max->c);
	printf(" %.1f\n",max->sum);
}
int main(){
	int n;
	cin >>n;
	student1 s=new student;
	s->next=NULL;
	student1 max=NULL;
	student1 h=NULL;
	student1 h1=NULL;
	h1=s;
	h=s;
	for(int i=1;i<=n;i++){
		s->next=new student;
		cin >> s->num;
		cin >> s->class1;
		cin >> s-&...
登录查看完整内容


登录后发布评论

暂无评论,来抢沙发