编写一个程序,输入n个学生的学号,姓名,3门课程的成绩,求出总分最高的学生并输出该学生的所有信息,

看看这个,应该符合你的要求:

///////////////////////////////////////
/* */
/* by autorun_inf */
/* */
///////////////////////////////////////

#include <stdio.h>

struct student
{
int no; //学号
char name[10];
float math,english,computer; //三门课程的成绩
double total; //总成绩
double avr; //平均成绩
};

struct student stu[50]; //声明一个结构数组变量

struct student input();
void display(struct student stud[],int count);
void sort(struct student stud[],int count);

void main()
{
int count;
char ch;
ch='y';

printf("请按以下格式输入学生信息(可用Tab键对齐):");
printf("\n");
count=0;
while ((ch=='y') || (ch=='Y'))
{
stu[count]=input(); //调用录入信息函数
count++;
printf("\n是否继续?(按Y继续,其它结束)");
scanf(" %c",&ch);
}
printf("\n最高分为:");
sort(stu,count); //调用排序函数
display(stu,1); //调用显示信息函数

}

struct student input() //录入信息函数
{
struct student studn;

printf("\n学号\t姓名\t数学\t英语\t计算机\n");
scanf("%d%s%f%f%f",&studn.no,studn.name,&studn.math,&studn.english,&studn.computer);

studn.total=studn.math+studn.english+studn.computer;
studn.avr=studn.total/3.0;

return studn;
}

void display(struct student stud[],int count) //显示信息函数
{
int i;
printf("\n学号\t姓名\t数学\t英语\t计算机\t总分\t平均分");
printf("\n");
for(i=0;i<count;i++)
{
printf("%d",stud[i].no);
printf("\t%s",stud[i].name);
printf("\t%.1f",stud[i].math);
printf("\t%.1f",stud[i].english);
printf("\t%.1f",stud[i].computer);
printf("\t%.2f",stud[i].total);
printf("\t%.2f",stud[i].avr);
printf("\n");
}
}

void sort(struct student stud[],int count) //排序函数
{
int i,j;

/* 冒泡排序法*/
struct student t;
for(i=0;i<count;i++)
for(j=0;j<count-i-1;j++) //比较元素
{
if(stud[j].avr<stud[j+1].avr)
{
t=stud[j];
stud[j]=stud[j+1];
stud[j+1]=t;
}
}
}

作业吧!
又想不劳而获……
过程才是编程的快乐哟!

#include "stdio.h"
#include "string.h"
#define NULL 0
typedef struct node
{long num;
char name[4];
float eng,math,com,total,ave;
struct node *next;
}LNode,*LinkedList;

LinkedList LinkedListCreat(LinkedList L )
{ LinkedList L,p,r,s,q;
int x,flag=-1;
float e,m,c;

printf("Please enter student numbers, input of -1 End \n");
scanf("%ld",&x);
while (x!=flag)
{ q=L;s=q->next;
while(s!=NULL&&s->num!=x)
{q=s; s=s->next;}
if(s==NULL)
{
p=(LinkedList)malloc(sizeof(LNode));
printf("Input student's name:");
scanf("%s\n",p->name);
printf("Input student's english:");
scanf("%f\n",&e);
printf("Input student's mathe:");
scanf("%f\n",&m);
printf("Input student's computer:");
scanf("%f\n",&c);
p->num=x;
p->eng=e;
p->math=m;
p->com=c;
p->total=(e+m+c);
p->ave=p->total/3.0;
if(L->next==NULL)
{ r=L;
r->next=p;
r=p;
r->next=NULL;
}
else
{q=L;s=q->next;
while(s!=NULL&&s->total>p->total)
{q=s; s=s->next;}
p->next=q->next; q->next=p;}
}
else
printf("have the same num,Resume load!\n ");
printf("Please enter student numbers, input of -1 End \n");
scanf("%ld",&x);
}
return L;
}

void print(LinkedList L) /*输出链表中的结点*/
{LinkedList p;
p=L->next;
printf("num\tname\tEnglish\t\tmathe\tcomputer\ttotal\tave\n");
while(p!=NULL)
{
printf("%ld\t%s\t%.2f\t\t%.2f\t%.2f\t\t%.2f\t%.2f\t\n",p->num,p->name,p->eng,p->math,p->com,p->total,p->ave);
p=p->next;
}
}

main( )
{LinkedList L;
L=(LinkedList)malloc(sizeof(LNode));
L->next=NULL;

L=LinkedListCreat( L);
print(L);
}

编写一个程序,输入n个学生的学号,姓民,3门课程的成绩,求出总分最高的学生并输出该学生的所有信息

你的错误是比不知道C语言的索引是从0开始的么,而不是1,
#include#define n 3struct STUDENT{ char name[20]; char number[10]; int score[3]; int sum;};main(){ int i=0,j=0,max=0,maxi=0; struct STUDENT stu[n]; for(i=0;i<n;i++) { printf("Please input student%d's information
",i+1); printf("Number:"); scanf("%s",stu[i].number); printf("Name:"); scanf("%s",stu[i].name); for(j=0;j<3;j++) { printf("Score[%d]:",j); scanf("%d",&stu[i].score[j]); } } for(i=0;i<n;i++) { for(j=0;j<3;j++) {stu[i].sum+=stu[i].score[j];} if(max<stu[i].sum) { max=stu[i].sum; maxi=i; } } printf("The highest student is student%d:%s %s %d %d %d
",maxi,stu[maxi].number,stu[maxi].name,stu[maxi].score[0],stu[maxi].score[1],stu[maxi].score[2]);}

......... scanf("%d", &n); for(i=0;i<n;i++){ scanf("%d%s",&stu[i].number,stu[i].name);stu[i].sum = 0; //先给sum赋初值,否则它是随机值,影响结果 for(j=0;j<3;j++){ scanf("%d",&stu[i].score[j]); stu[i].sum+=stu[i].score[j]; } } .......


VB输入N个学生的学号和成绩,打印出成绩最高者的学号和成绩
Private Sub Command1_Click()Picture1.AutoRedraw = True If i >= 5 Then MsgBox ("最多只能输入5个学生信息"): Text1.Text = "": Text2.Text = ""Text1.Locked = True: Text2.Locked = True Else If Text1 = "" Or Text2 = "" Then N = MsgBox("请认真填写学生的基本信息",...

输入若干个学生信息(学号、姓名和成绩),输入学号为0时输入结束。建立一...
ptr1->next=ptr2->next;free(ptr2);} else ptr1=ptr2;ptr2=ptr1->next;} return head;} void Ptrint_Stu_Doc(struct stud_node *head){ struct stud_node*ptr;if(head==NULL){ printf("\\nNo Records\\n");return;} for(ptr=head; ptr; ptr=ptr->next)printf("%d %s %d\\n", ...

编写C语言程序处理若干个学生的信息,每个学生的信息包括:学号、姓名...
\/\/这里用来读入学生信息 printf("Pls enter your Info,as :2007 aaa 97 98 99\\n");for(i=0;i<N;i++){ scanf("%ld %s %d %d %d",&stu[i].num,stu[i].name,&stu[i].score[0],&stu[i].score[1],&stu[i].score[2]);} \/\/下面是用来显示输入的用户信息 for(i=0;i<N;i...

...结构体 输入学生个数n。输入这n个学生姓名、学号、五门课成绩。输 ...
printf("Please input the information:\\n") ;\/\/输入学生信息 for(i=0;i<n;i++)\/\/输入姓名(如 bill gates){ scanf("%c",&ch);while(ch!='\\n'){ Ptr[i].name[p]=ch;p++;scanf("%c",&ch);} Ptr[i].name[p+1]=0;scanf("%c",ch);\/\/输入学号(含字母、数字)while(...

已知学生记录由学号和成绩组成,输入n个学生的学号和成绩。找出成绩最高...
要不你试着把printf("%12s%5f\\n",pstu[i]->no,pstu[i]->grade);改成printf("%12s%5lf\\n",pstu[i]->no,pstu[i]->grade);我乱猜的,太长懒得看

c++读入n名学生的姓名、学号、成绩,分别输出成绩最高和成绩最低学生的...
我看了一下你的代码,发现你的思路是:分数在0-100之间且不存在两个相同的分数,于是,用相对应得分数储存数据,而且用一个judge为真假来判断该位置是否被占用。寻找最大的方式是从100往下看,当遇到第一个judge为真的时候就是最大,最小的反之即可。然后,我发现你的错误是:judge[j]=1,应该改为...

C语音编程题(一个班级有N个学生,每个学生有学号、姓名,学生学习课程...
printf("请输入第%d名学生的英语分数:\\n",i+1);if(stu[j].totalScore>stu[j+1].totalScore){ studenttempStu;printf("名次学号姓名语文数学英语总分平均分\\n");for(i=0;i<n;i++)return0;} 简洁的语言 C语言包含的各种控制语句仅有9种,关键字也只有32个,程序的编写要求不严格且以小写...

编写一个c语言程序,实现录入学生学号和姓名信息的功能
include<stdio.h> include<stdlib.h> intmain(void){ chars[10];\/\/姓名 intnum;\/\/学号 printf("请输入姓名:\\n");gets(s);printf("请输学号:\\n");scanf("%d",&num);printf("姓名是:%s\\n学号是:%d\\n",s,num);system("pause");return0;} ...

编写一个c语言程序,实现录入学生学号和姓名信息的功能
1、首先创建一个c语言项目。然后右键头文件,创建一个Stu的头文件。2、然后编写头文件的代码。再将数据结构的增删改查和结构体写入头文件。3、然后在源文件中创建main源文件和Stu源文件。再main文件中写入int mian()代码。4、然后在mian主函数中,写入while语句无限循环。再写入Init函数。5、然后在...

输入若干个学生信息(学号 姓名 成绩) 输入学号为0时输入结束 建立一个...
2、定义两个student类型的变量,保存所有学生的成绩信息和临时变量。3、定义一个自定义函数,输入学生的成绩信息。4、具体实现学生信息的输入,并计算总分。5、主函数中,先定义4个整型变量,保存学生的总数,以及控制循环的变量。6、接着,输入学生总数,保存在变量n中。7、运行程序查看最后结果。注意...