【C++】用结构体完成:编程求出3个学生中某个学生的平均成绩

//用结构体完成:编程求出3个学生中某个学生的平均成绩
#include 
#include 
using namespace std;
struct student
{
	char *name;
	double score[3];
};
struct student stu[3]={{"han",80,90,95},{"zhao",78,85,92},{"dan",75,60,59}};  //初始化
struct student *find(struct student *s)
{
	char name1[20];
	cout<<"请输入您要查找的学生姓名:";
	cin>>name1;
	for(int i(0);i<3;i++)
		if(strcmp(name1,s[i].name)==0)
			return s+i;
	cout<<"您要查找的人不存在。"<name<<": "<<(p->score[0]+p->score[1]+p->score[3])/3<

你可能感兴趣的:(指针,结构体数组,C++)