文章
67
粉丝
207
获赞
29
访问
36.5k
#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-&...
登录后发布评论
暂无评论,来抢沙发