Description
读入学生的信息:学号(8位整数)、姓名(20个字符)、性别(1个字符)3门课的成(2位小数)。计算每个学生的平均成绩(2位小数),总成绩(2位小数)信息。调用函数读入原始测试数据。调用函数按学号检索数据,并返回该同学的指针。在主函数中输出检索结果。
Input
首先输入n表明有n个学生,接下来是n个学生的基础信息,然后是要检索数据的条件,学号。
Output
输出检索结果,若没有,则返回0;
Sample Input
3
20140101 Li Ming M 85 90 92
20140202 Zhao Li F 98 78 88
20140015 Lu Yao M 89.4 86.5 88
20140202
Sample Output
20140202 Zhao Li F 98.00 78.00 88.00 88.00 264.00
#include <bits/stdc++.h>
using namespace std;
struct stu
{
int num;
char name1[20];//姓和名字分开,可以使用两个串
char name2[20];
char s;
double g[7];
}st[100];
void get(struct stu st[