\提问不让重复输入%d和\t我给删了;
#include "tool.h"
#include <stdio.h>
#include <string.h>
int Count = 0;
void new_meber(stu* menber[])
{
printf("How many student do you have?\n");
scanf("d",&Count);
printf("Please enter their num,name,the score of computer,math and english:\n");
for (int i = 0; i < Count; ++i)
{
printf("No.%d\n",i+1 );
scanf("ds",&menber[i]->num,menber[i]->name,&menber[i]->computer,&menber[i]->math,&menber[i]->english);
}
}
void average(stu* menber[])
{
for (int i = 0; i < Count; ++i)
{
menber[i]->average = (menber[i]->computer+menber[i]->math+menber[i]->english)/3;
}
}
void output_student(stu* menber[])
{
printf("Num\tName\tComputer\tMath\tEnglish\t\n");
for (int i = 0; i < Count; ++i)
{
printf("n",menber[i]->num,menber[i]->name,menber[i]->computer,menber[i]->math,menber[i]->english);
}
}
void sort(stu* menber[])
{
int index;
stu* temp;
for (int i = 0; i < Count-1; ++i)
{
index = i;
for (int j = i+1; j < Count; ++j)
{
if (menber[j]->average>menber[index]->average)
{
index = j;
}
}
temp = menber[index];menber[index] = menber[i];menber[i] = temp;
}
}
void modify(stu* menber[])
{
int num;
printf("Please enter the num of student:\n");
scanf("d",&num);
for (int i = 0; i < Count; ++i)
{
if (menber[i]->num == num)
{
printf("Please enter his/her num,name,the score of computer,math and english:\n");
scanf("ds",&menber[i]->num,menber[i]->name,&menber[i]->computer,&menber[i]->math,&menber[i]->english);
}
else
{
printf("I don't find it\n");
break;
}
}
}